-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathwebpack.config.js
38 lines (36 loc) · 938 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var libraryName = 'sosh';
var outputFile = libraryName + '.js';
module.exports = {
entry: path.resolve(__dirname, 'src/js/index.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: outputFile,
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
loaders: [
{
test: /\.scss$/,
loader: 'style!css?minimize!postcss!sass'
},
{
test: /\.(png|jpg|jpeg|webp|gif)$/,
loader: 'url?limit=20000&name=img/[name].[ext]'
},
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
],
resolve: {extensions: ['', '.js', '.scss']},
postcss: [autoprefixer()],
}