More fixes for aspnet-webpack

This commit is contained in:
SteveSandersonMS
2016-03-11 01:01:22 +00:00
parent dfc2f9503b
commit 5e7e75cc0b
5 changed files with 17 additions and 12 deletions

View File

@@ -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": {

View File

@@ -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 } = {};

View File

@@ -1,3 +1,3 @@
declare module 'memory-fs' {
export default class MemoryFS {}
export namespace memoryfs {
export class MemoryFS {}
}

View File

@@ -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;
}

View File

@@ -1,12 +1,12 @@
declare module 'webpack-externals-plugin' {
import * as webpack from 'webpack';
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);
}
}