-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
51 lines (44 loc) · 1.02 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
'use strict';
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin')
/**
* Env
* Get npm lifecycle event to identify the environment
*/
var ENV = process.env.npm_lifecycle_event;
var isTest = ENV === 'test' || ENV === 'test-watch';
var isProd = ENV === 'build';
module.exports = {
entry: './ui-src/main.js',
output: {
filename: './js/bundle.js'
},
mode: isProd ? 'production' : 'development',
plugins: [
new CopyWebpackPlugin([
// copy index.html
{
from: 'ui-src/index.html',
to: 'index.html'
},
// copy angular templates
{
from: 'ui-src/*/*.template.html',
test: /(.+)\/(.+)\/(.+)\.html$/,
to: '[2]/[name].[ext]'
},
// copy css
{
from: 'ui-src/css/*.css',
to: 'css/[name].[ext]'
},
])
],
devServer: {
contentBase: './ui-src',
port: 3000,
proxy: {
'/api': 'http://localhost:8080'
}
}
};