diff --git a/package.json b/package.json index b7fe38a0ff..413161f98b 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@types/lodash": "ts2.0", "@types/memory-cache": "0.0.29", "@types/mime": "1.3.1", - "@types/node": "8.0.13", + "@types/node": "8.0.14", "@types/serve-static": "1.7.31", "@types/source-map": "0.5.0", "@types/webfontloader": "1.6.28", @@ -194,6 +194,7 @@ "webpack-bundle-analyzer": "2.8.3", "webpack-dev-middleware": "1.11.0", "webpack-dev-server": "2.5.1", - "webpack-merge": "4.1.0" + "webpack-merge": "4.1.0", + "webpack-node-externals": "1.6.0" } } diff --git a/rollup.config.js b/rollup.config.js index 68bebc26b0..a47b46dd37 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,3 @@ -import rollup from 'rollup' import nodeResolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs'; import uglify from 'rollup-plugin-uglify' diff --git a/webpack/webpack.server.js b/webpack/webpack.server.js index 0671278dd0..a52e0546a4 100644 --- a/webpack/webpack.server.js +++ b/webpack/webpack.server.js @@ -1,3 +1,5 @@ +var nodeExternals = require('webpack-node-externals'); + const { root } = require('./helpers'); @@ -7,5 +9,8 @@ module.exports = { output: { filename: 'server.js' }, - target: 'node' + target: 'node', + externals: [nodeExternals({ + whitelist: [/@ng/] + })], }; diff --git a/webpack/webpack.test.js b/webpack/webpack.test.js index 2948473370..a353dec9d6 100644 --- a/webpack/webpack.test.js +++ b/webpack/webpack.test.js @@ -8,7 +8,6 @@ const { const ProvidePlugin = require('webpack/lib/ProvidePlugin'); const DefinePlugin = require('webpack/lib/DefinePlugin'); const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin'); -const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin'); /** * Webpack Constants @@ -242,22 +241,6 @@ module.exports = function (options) { } }), - /** - * Plugin: ContextReplacementPlugin - * Description: Provides context to Angular's use of System.import - * - * See: https://webpack.github.io/docs/list-of-plugins.html#contextreplacementplugin - * See: https://github.com/angular/angular/issues/11580 - */ - new ContextReplacementPlugin( - // The (\\|\/) piece accounts for path separators in *nix and Windows - /angular(\\|\/)core(\\|\/)@angular/, - root('src'), // location of your src - { - // your Angular Async Route paths relative to this root directory - } - ), - /** * Plugin LoaderOptionsPlugin (experimental) * diff --git a/yarn.lock b/yarn.lock index 2e5fefacf3..d03f9f84c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -196,10 +196,14 @@ version "2.0.29" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" -"@types/node@*", "@types/node@8.0.13": +"@types/node@*": version "8.0.13" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.13.tgz#530f0f9254209b0335bf5cc6387822594ef47093" +"@types/node@8.0.14": + version "8.0.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.14.tgz#4a19dc6bb61d16c01cbadc7b30ac23518fff176b" + "@types/node@^6.0.46": version "6.0.52" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.52.tgz#1ac3a99b42320f9e463482f25af4c2359473aaa6" @@ -7454,6 +7458,10 @@ webpack-merge@4.1.0: dependencies: lodash "^4.17.4" +webpack-node-externals@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.6.0.tgz#232c62ec6092b100635a3d29d83c1747128df9bd" + webpack-sources@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb"