-
Notifications
You must be signed in to change notification settings - Fork 21
/
webpack.config.js
56 lines (54 loc) · 1.1 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
/* global require module */
var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './app/index.js',
output: {
filename: 'drawing-tool.js',
path: path.resolve(__dirname, 'dist'),
library: 'DrawingTool',
libraryTarget: 'umd'
},
module: {
rules: [
{
test: /\.scss$/,
use: [{
loader: 'file-loader', // saves css to file
options: {
name: "[name].css"
}
}, {
loader: 'sass-loader' // compiles Sass to CSS
}]
},
{
// Support ?123 suffix, e.g. ../fonts/m4d-icons.eot?3179539#iefix
test: /\.(eot|ttf|woff|woff2|svg)((\?|\#).*)?$/,
loader: 'url-loader?limit=8192'
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{from: 'public'}
]
})
],
externals: [
{
'jquery': {
root: 'jQuery',
commonjs2: 'jquery',
commonjs: 'jquery',
amd: 'jquery'
}
}
],
devServer: {
watchOptions: {
ignored: /node_modules/
}
}
};