-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
40 lines (39 loc) · 1.25 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
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, 'app');
const config = {
context: appRoot,
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'angular-sanji-window.js'
},
resolve: {
alias: {
'angular-material.css': nodeRoot + '/angular-material/angular-material.css',
'angular-material-icons.css': nodeRoot + '/angular-material-icons/angular-material-icons.css',
'angular-busy.css': nodeRoot + '/angular-busy/angular-busy.css'
},
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, '/app/index.html')]
}
]
},
plugins: [
new webpack.DefinePlugin({
__TEST__: 'test' === NODE_ENV,
__DEV__: 'development' === NODE_ENV,
__RELEASE__: 'production' === NODE_ENV
})
]
};
module.exports = config;