mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
More fixes for aspnet-webpack
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aspnet-webpack",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "Helpers for using Webpack in ASP.NET projects. Works in conjunction with the Microsoft.AspNet.SpaServices NuGet package.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -4,12 +4,17 @@
|
||||
// that your loader plugins (e.g., require('./mystyles.less')) work in exactly the same way on the server as
|
||||
// on the client.
|
||||
import 'es6-promise';
|
||||
import ExternalsPlugin from 'webpack-externals-plugin';
|
||||
import requireFromString from 'require-from-string';
|
||||
import MemoryFS from 'memory-fs';
|
||||
import * as webpack from 'webpack';
|
||||
import { requireNewCopy } from './RequireNewCopy';
|
||||
|
||||
// Strange import syntax to work around https://github.com/Microsoft/TypeScript/issues/2719
|
||||
import { webpackexternals } from './typings/webpack-externals-plugin';
|
||||
import { requirefromstring } from './typings/require-from-string';
|
||||
import { memoryfs } from './typings/memory-fs';
|
||||
const ExternalsPlugin = require('webpack-externals-plugin') as typeof webpackexternals.ExternalsPlugin;
|
||||
const requireFromString = require('require-from-string') as typeof requirefromstring.requireFromString;
|
||||
const MemoryFS = require('memory-fs') as typeof memoryfs.MemoryFS;
|
||||
|
||||
// Ensure we only go through the compile process once per [config, module] pair
|
||||
const loadViaWebpackPromisesCache: { [key: string]: any } = {};
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
declare module 'memory-fs' {
|
||||
export default class MemoryFS {}
|
||||
export namespace memoryfs {
|
||||
export class MemoryFS {}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
declare module 'require-from-string' {
|
||||
export default function requireFromString<T>(fileContent: string): T;
|
||||
export namespace requirefromstring {
|
||||
export function requireFromString<T>(fileContent: string): T;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
declare module 'webpack-externals-plugin' {
|
||||
import * as webpack from 'webpack';
|
||||
|
||||
export namespace webpackexternals {
|
||||
export interface ExternalsPluginOptions {
|
||||
type: string;
|
||||
include: webpack.LoaderCondition;
|
||||
}
|
||||
|
||||
export default class ExternalsPlugin {
|
||||
export class ExternalsPlugin {
|
||||
constructor(options: ExternalsPluginOptions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user