1 /* Copyright 2017 ZTE Corporation.
3 *Licensed under the Apache License, Version 2.0 (the "License");
4 *you may not use this file except in compliance with the License.
5 *You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
15 const ExtractTextPlugin = require('extract-text-webpack-plugin');
16 const DefinePlugin = require('webpack/lib/DefinePlugin');
17 const CopyWebpackPlugin = require('copy-webpack-plugin');
18 const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
19 const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
22 const webpack = require('webpack');
23 const commonConfig = require('./webpack.common.js');
24 const webpackMerge = require('webpack-merge');
25 const helpers = require('./helpers');
28 module.exports = webpackMerge(commonConfig, {
31 devtool: 'source-map',
36 path: helpers.root('holmes'),
38 filename: '[name].[chunkhash].bundle.js',//'[name].[hash].js',
40 sourceMapFilename: '[name].[chunkhash].bundle.map',
43 chunkFilename: '[id].[chunkhash].chunk.js'//'[id].[hash].chunk.js'
55 loader: ExtractTextPlugin.extract({
56 fallback: 'style-loader',
65 include: [helpers.root('alarm/assets'), helpers.root('public'),helpers.root('alarm/app')]
73 new webpack.NoErrorsPlugin(),
75 new webpack.optimize.DedupePlugin(),
77 new webpack.optimize.UglifyJsPlugin({
85 new ExtractTextPlugin('[name].[contenthash].css'),
92 new LoaderOptionsPlugin({
104 clearImmediate: false,