-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
55 lines (50 loc) · 1.44 KB
/
webpack.dev.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
/**
* Created by luxiaolong on 2017/6/16.
*/
var path = require('path');
var webpack = require('webpack');
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
module.exports = {
devtool: 'cheap-module-source-map',
entry: './src/index.js',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: "/dist",
library: 'BindingUtils',
libraryTarget: "umd"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
'babel-loader'
,'eslint-loader'
]
}, {
test: /.less|css$/,
use: [{
loader: 'style-loader' // creates style nodes from JS strings
}, {
loader: 'css-loader' // translates CSS into CommonJS
}, {
loader: 'less-loader',
options: {
strictMath: true,
noIeCompat: true
} // compiles Less to CSS
}]
}, {
test: /\.(eot|svg|ttf|woff|jpe?g|png|gif)/i,
use: [
'url-loader?limit=102400'
]
}
]
},
plugins: [
new OpenBrowserPlugin({ url: 'http://localhost:8080' })
]
};