-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
39 lines (38 loc) · 1.09 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
const path = require('path');
const webpack = require('webpack');
const NODE_ENV = process.env.NODE_ENV;
const nodeRoot = path.join(__dirname, 'node_modules');
const appRoot = path.join(__dirname, 'src');
const config = {
context: appRoot,
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'sanji-utils-ui.js'
},
resolve: {
alias: {
'angular-material.css': nodeRoot + '/angular-material/angular-material.css',
'toastr.scss': nodeRoot + '/toastr/toastr.scss'
},
extensions: ['.js', '.json', 'html', 'scss', 'css']
},
module: {
rules: [
{ test: /\.js$/, use: 'eslint-loader', exclude: /node_modules/, enforce: 'pre' },
{ test: /\.js$/, use: 'babel-loader?cacheDirectory', exclude: /(node_modules)/ },
{
test: /\.html$/,
use: 'ng-cache-loader?prefix=[dir]/[dir]',
exclude: [/node_modules/, path.join(__dirname, '/src/index.html')]
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(NODE_ENV || 'development')
}
})
]
};
module.exports = config;