-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
43 lines (42 loc) · 1.39 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
const path = require('path');
const webpack = require('webpack');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
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-auth-ui.js'
},
resolve: {
alias: {
'angular-material.css': nodeRoot + '/angular-material/angular-material.css',
'angular-material-icons.css': nodeRoot + '/angular-material-icons/angular-material-icons.css',
'toastr.scss': nodeRoot + '/toastr/toastr.scss',
'svg-morpheus': nodeRoot + '/svg-morpheus/compile/unminified/svg-morpheus.js'
},
extensions: ['.js', '.json', 'html', 'scss', 'css']
},
module: {
rules: [
{ test: /\.js$/, use: 'eslint-loader?fix', 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 LodashModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(NODE_ENV || 'development')
}
})
]
};
module.exports = config;