-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.37 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
var path = require("path"),
openBrowserWebpackPlugin = require('open-browser-webpack-plugin'),
ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './src/js/dui.js',
output: {
path: __dirname + "/dist/", // 输出文件的保存路径
publicPath: "/dist/",
filename: 'js/dui.js', // 输出文件的名称
library: 'Dui',
libraryTarget: 'umd'
},
devtool: "source-map",
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel?presets[]=es2015'],
exclude: /node_modules/
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!sass-loader", {publicPath: "../"})
},
{
test: /\.html$/,
loader: "html?minimize=true"
}
]
},
htmlLoader: {
root: path.resolve(__dirname, 'src/js/component/template')
},
devServer: {
stats: { colors: true },
publicPath: "/dist/",
contentBase: 'demo',
port: 8070,
watch: true,
progress: true,
"display-error-details": true
},
plugins: [
new ExtractTextPlugin("css/dui.css"),
new openBrowserWebpackPlugin({ url: 'http://localhost:8070' })
]
}