2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
23 var path = require('path');
24 var webpack = require('webpack');
26 var localDevConfig = {};
28 localDevConfig = require('./devConfig');
30 var devConfig = Object.assign({}, require('./devConfig.defaults'), localDevConfig);
31 var devPort = process.env.PORT || devConfig.port;
32 var latestProgress = 0;
35 devtool: 'eval-source-map',
38 'sdc-app/sdc.app.jsx',
39 `webpack-dev-server/client?http://localhost:${devPort}`,
40 'webpack/hot/only-dev-server'
43 'sdc-app/punch-outs.js',
44 `webpack-dev-server/client?http://localhost:${devPort}`,
45 'webpack/hot/only-dev-server'
48 'sdc-app/heatValidation.app.jsx',
49 `webpack-dev-server/client?http://localhost:${devPort}`,
50 'webpack/hot/only-dev-server'
54 root: [path.resolve('.')],
56 i18nJson: 'nfvo-utils/i18n/locale.json',
57 'nfvo-utils': 'src/nfvo-utils',
58 'nfvo-components': 'src/nfvo-components',
59 'sdc-app': 'src/sdc-app'
63 path: path.join(__dirname, 'dist/dev'),
64 publicPath: `http://localhost:${devPort}/onboarding/`,
69 historyApiFallback: true,
70 publicPath: `http://localhost:${devPort}/onboarding/`,
71 contentBase: path.join(__dirname, 'dist/dev'),
82 {test: /\.(js|jsx)$/, loader: 'source-map-loader', exclude: /node_modules/}
85 {test: /\.(js|jsx)$/, loaders: ['react-hot', 'babel-loader', 'eslint-loader'], exclude: /node_modules/},
86 {test: /\.(css|scss)$/, loaders: ['style', 'css?sourceMap', 'sass?sourceMap']},
88 // required for font icons
89 {test: /\.(woff|woff2)(\?.*)?$/, loader: 'url-loader?limit=16384&mimetype=application/font-woff' },
90 {test: /\.(ttf|eot|otf)(\?.*)?$/, loader: 'file-loader' },
91 {test: /\.(png|jpg|svg)(\?.*)?$/, loader: 'url-loader?limit=16384'},
93 {test: /\.json$/, loaders: ['json']},
94 {test: /\.html$/, loaders: ['html']}
98 configFile: './.eslintrc',
103 new webpack.DefinePlugin({
107 new webpack.HotModuleReplacementPlugin(),
108 new webpack.ProgressPlugin(function (percentage, msg) {
109 if (percentage == 0) {
111 console.log(); //new line
113 var progressVal = (percentage * 100).toFixed(0);
114 if (progressVal > latestProgress) {
115 latestProgress = progressVal
116 //process.stdout.clearLine();
117 process.stdout.write(msg + ' ' + progressVal + '%\r');