From 631dfc17dcfcb683f4cd9836a6489966553e5317 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 15 Mar 2017 17:51:04 +0200 Subject: [PATCH] build: fix build with ng4 --- build/webpack.common.js | 19 +++++++++---------- build/webpack.prod.js | 12 ------------ build/webpack.test.js | 7 ++++++- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/build/webpack.common.js b/build/webpack.common.js index 5ff99d08..30e9a57d 100644 --- a/build/webpack.common.js +++ b/build/webpack.common.js @@ -3,7 +3,6 @@ const webpack = require('webpack'); const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin; const StringReplacePlugin = require("string-replace-webpack-plugin"); const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'); -const ngcWebpack = require('ngc-webpack'); const VERSION = JSON.stringify(require('../package.json').version); @@ -123,15 +122,15 @@ module.exports = function (options) { } }; - if (options.AOT) { - conf.plugins.push( - new ngcWebpack.NgcWebpackPlugin({ - disable: !options.AOT, - tsConfig: root('tsconfig.webpack.json'), - resourceOverride: root('build/resource-override.js') - }) - ); - } + // if (options.AOT) { + // conf.plugins.push( + // new ngcWebpack.NgcWebpackPlugin({ + // disable: !options.AOT, + // tsConfig: root('tsconfig.webpack.json'), + // resourceOverride: root('build/resource-override.js') + // }) + // ); + // } return conf; } diff --git a/build/webpack.prod.js b/build/webpack.prod.js index 1b517d66..e14a5f5b 100644 --- a/build/webpack.prod.js +++ b/build/webpack.prod.js @@ -49,18 +49,6 @@ const config = webpackMerge(commonConfig({ minimize: true, debug: false }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - screw_ie8: true, - negate_iife: false // for lazy v8 - }, - mangle: { screw_ie8 : true }, - output: { - comments: false - }, - sourceMap: true - }), new webpack.BannerPlugin(BANNER) ] }) diff --git a/build/webpack.test.js b/build/webpack.test.js index e1296d74..551b1b4c 100644 --- a/build/webpack.test.js +++ b/build/webpack.test.js @@ -1,6 +1,7 @@ const webpack = require('webpack'); const root = require('./helpers').root; +const path = require('path'); const webpackMerge = require('webpack-merge'); // used to merge webpack configs const commonConfig = require('./webpack.common.js'); @@ -57,6 +58,10 @@ module.exports = webpackMerge(commonConfig({ /\.tmp[\\\/].*$/, /dist[\\\/].*$/, /(?:[^\\\/]*(?:[\\\/]|$))*[^\\\/]*\.css$/ // ignore css files - ]) + ]), + new webpack.ContextReplacementPlugin( + /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, + path.resolve(__dirname, '../src') + ) ], })