Skip to content

Commit 5e7e75c

Browse files
More fixes for aspnet-webpack
1 parent dfc2f95 commit 5e7e75c

5 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎src/Microsoft.AspNet.SpaServices/npm/aspnet-webpack/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aspnet-webpack",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Helpers for using Webpack in ASP.NET projects. Works in conjunction with the Microsoft.AspNet.SpaServices NuGet package.",
55
"main": "index.js",
66
"scripts": {

‎src/Microsoft.AspNet.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
// that your loader plugins (e.g., require('./mystyles.less')) work in exactly the same way on the server as
55
// on the client.
66
import 'es6-promise';
7-
import ExternalsPlugin from 'webpack-externals-plugin';
8-
import requireFromString from 'require-from-string';
9-
import MemoryFS from 'memory-fs';
107
import * as webpack from 'webpack';
118
import { requireNewCopy } from './RequireNewCopy';
129

10+
// Strange import syntax to work around https://github.com/Microsoft/TypeScript/issues/2719
11+
import { webpackexternals } from './typings/webpack-externals-plugin';
12+
import { requirefromstring } from './typings/require-from-string';
13+
import { memoryfs } from './typings/memory-fs';
14+
const ExternalsPlugin = require('webpack-externals-plugin') as typeof webpackexternals.ExternalsPlugin;
15+
const requireFromString = require('require-from-string') as typeof requirefromstring.requireFromString;
16+
const MemoryFS = require('memory-fs') as typeof memoryfs.MemoryFS;
17+
1318
// Ensure we only go through the compile process once per [config, module] pair
1419
const loadViaWebpackPromisesCache: { [key: string]: any } = {};
1520

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
declare module 'memory-fs' {
2-
export default class MemoryFS {}
1+
export namespace memoryfs {
2+
export class MemoryFS {}
33
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
declare module 'require-from-string' {
2-
export default function requireFromString<T>(fileContent: string): T;
1+
export namespace requirefromstring {
2+
export function requireFromString<T>(fileContent: string): T;
33
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
declare module 'webpack-externals-plugin' {
2-
import * as webpack from 'webpack';
3-
1+
import * as webpack from 'webpack';
2+
3+
export namespace webpackexternals {
44
export interface ExternalsPluginOptions {
55
type: string;
66
include: webpack.LoaderCondition;
77
}
88

9-
export default class ExternalsPlugin {
9+
export class ExternalsPlugin {
1010
constructor(options: ExternalsPluginOptions);
1111
}
1212
}

0 commit comments

Comments
 (0)