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 webpackMerge = require('webpack-merge');
16 const commonConfig = require('./webpack.common.js');
17 const helpers = require('./helpers');
23 const DefinePlugin = require('webpack/lib/DefinePlugin');
24 const ExtractTextPlugin = require('extract-text-webpack-plugin');
25 const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
26 const CopyWebpackPlugin = require('copy-webpack-plugin');
29 module.exports = webpackMerge(commonConfig, {
34 devtool: 'source-map',
42 path: helpers.root('holmes'),
45 filename: '[name].bundle.js',
48 sourceMapFilename: '[name].map',
51 chunkFilename: '[id].chunk.js'
63 loader: 'tslint-loader',
65 configFile: 'tslint.json',
73 header: '<?xml version="1.0" encoding="utf-8"?>\n<checkstyle version="5.7">',
75 footer: '</checkstyle>'
80 exclude: [/\.(spec|e2e)\.ts$/]
85 use: ['to-string-loader', 'style-loader', 'css-loader'],
86 include: [helpers.root('alarm/assets'), helpers.root('public')]
98 new CopyWebpackPlugin([
99 { from: helpers.root('public/thirdparty/js/jquery_1.12.4.min.js'), to: helpers.root('holmes/public/js') },
100 { from: helpers.root('public/common/js/popModal.js'), to: helpers.root('holmes/public/js') },
101 { from: helpers.root('public/common/js/jQuery-File-Upload/js/jquery.ui.widget.js'), to: helpers.root('holmes/public/js') },
102 { from: helpers.root('public/common/js/jQuery-File-Upload/js/vendor/jquery.ui.widget.js'), to: helpers.root('holmes/public/js') },
103 { from: helpers.root('public/common/js/jQuery-File-Upload/js/jquery.iframe-transport.js'), to: helpers.root('holmes/public/js') },
104 { from: helpers.root('public/common/js/jQuery-File-Upload/js/jquery.fileupload.js'), to: helpers.root('holmes/public/js') },
105 { from: helpers.root('i18n'), to: helpers.root('holmes/i18n') },
106 { from: helpers.root('public/thirdparty/images/'), to: helpers.root('holmes/public/thirdparty/images') }
112 VERSION: JSON.stringify('version'),
113 CONST2: JSON.stringify('CONST2')
129 historyApiFallback: true,
147 clearImmediate: false,