3 const path = require('path');
4 const merge = require('webpack-merge');
5 const webpack = require('webpack');
6 const ServerConfig = require('./webpack.server');
7 const webpackCommonConfig = require('./webpack.common');
8 const {GlobCopyWebpackPlugin, BaseHrefWebpackPlugin} = require('@angular/cli/plugins/webpack');
9 const CopyWebpackPlugin = require('copy-webpack-plugin');
11 var currentTime = new Date().getTime();
15 // '/sdc1/scripts/inline',
16 // '/sdc1/scripts/polyfills',
17 // '/sdc1/scripts/vendor',
18 // '/sdc1/scripts/main',
19 // '/sdc1/scripts/sw-register',
20 // '/sdc1/scripts/scripts',
21 // '/sdc1/scripts/styles'
25 const webpackProdConfig = {
28 {test: /\.(eot|svg)$/, loader: "file-loader?name=/scripts/fonts/[name].[hash:20].[ext]"},
30 test: /\.(jpg|png|gif|otf|ttf|woff|woff2|cur|ani)$/,
31 loader: "url-loader?name=/scripts/images/[name].[hash:20].[ext]&limit=10000"
36 path: path.join(process.cwd(), "dist"),
37 filename: "[name]." + currentTime + ".bundle.js",
38 chunkFilename: "[id].chunk.js",
42 new webpack.DefinePlugin({
43 __DEBUG__: JSON.stringify(false),
44 __ENV__: JSON.stringify('prod')
47 new CopyWebpackPlugin([
49 from: './src/index.html', transform: function (content, path) {
50 content = (content + '').replace(/\.bundle/g, '.' + currentTime + '.bundle');
55 new webpack.optimize.UglifyJsPlugin({
70 module.exports = merge(webpackProdConfig, webpackCommonConfig(params));