build: fix build with ng4

This commit is contained in:
Roman Hotsiy 2017-03-15 17:51:04 +02:00
parent fb629fa7d7
commit 631dfc17dc
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 15 additions and 23 deletions

View File

@ -3,7 +3,6 @@ const webpack = require('webpack');
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin; const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
const StringReplacePlugin = require("string-replace-webpack-plugin"); const StringReplacePlugin = require("string-replace-webpack-plugin");
const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'); const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
const ngcWebpack = require('ngc-webpack');
const VERSION = JSON.stringify(require('../package.json').version); const VERSION = JSON.stringify(require('../package.json').version);
@ -123,15 +122,15 @@ module.exports = function (options) {
} }
}; };
if (options.AOT) { // if (options.AOT) {
conf.plugins.push( // conf.plugins.push(
new ngcWebpack.NgcWebpackPlugin({ // new ngcWebpack.NgcWebpackPlugin({
disable: !options.AOT, // disable: !options.AOT,
tsConfig: root('tsconfig.webpack.json'), // tsConfig: root('tsconfig.webpack.json'),
resourceOverride: root('build/resource-override.js') // resourceOverride: root('build/resource-override.js')
}) // })
); // );
} // }
return conf; return conf;
} }

View File

@ -49,18 +49,6 @@ const config = webpackMerge(commonConfig({
minimize: true, minimize: true,
debug: false 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) new webpack.BannerPlugin(BANNER)
] ]
}) })

View File

@ -1,6 +1,7 @@
const webpack = require('webpack'); const webpack = require('webpack');
const root = require('./helpers').root; const root = require('./helpers').root;
const path = require('path');
const webpackMerge = require('webpack-merge'); // used to merge webpack configs const webpackMerge = require('webpack-merge'); // used to merge webpack configs
const commonConfig = require('./webpack.common.js'); const commonConfig = require('./webpack.common.js');
@ -57,6 +58,10 @@ module.exports = webpackMerge(commonConfig({
/\.tmp[\\\/].*$/, /\.tmp[\\\/].*$/,
/dist[\\\/].*$/, /dist[\\\/].*$/,
/(?:[^\\\/]*(?:[\\\/]|$))*[^\\\/]*\.css$/ // ignore css files /(?:[^\\\/]*(?:[\\\/]|$))*[^\\\/]*\.css$/ // ignore css files
]) ]),
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
path.resolve(__dirname, '../src')
)
], ],
}) })