-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathwebpack.config.js
62 lines (60 loc) · 1.26 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
52
53
54
55
56
57
58
59
60
61
62
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractSass = new ExtractTextPlugin('styles/riot-mui.min.css');
var plugins = [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
test: /-min\.js$/
}),
extractSass
];
module.exports = {
entry: {
'riot-mui': './src/index',
'riot-mui-min': './src/index',
},
output: {
path: __dirname + '/build/',
filename: 'js/[name].js'
},
plugins: plugins,
devtool: false,
module: {
rules: [{
test: /\.tag$/,
enforce: 'pre',
exclude: /node_modules/,
loader: 'riotjs-loader',
query: {
type: 'none'
}
}, {
test: /\.js|\.tag|\.es6$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
query: {
presets: ['es2015-riot']
}
}]
}, {
test: /\.scss$/,
use: extractSass.extract({
fallback: 'style-loader',
use: [{
loader: 'css-loader',
query: {
minimize: true
}
}, 'sass-loader']
})
}]
},
devServer: {
contentBase: './',
historyApiFallback: true,
hot: true,
host: '0.0.0.0',
inline: true
}
};