-
Notifications
You must be signed in to change notification settings - Fork 73
/
webpack.conf.dev.js
67 lines (63 loc) · 1.7 KB
/
webpack.conf.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
56
57
58
59
60
61
62
63
64
65
66
67
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const babelConfig = require('./babel.conf.js')
function factory(vendor) {
return {
mode: 'development',
entry: `./demo/transfer/${vendor}/index`,
output: {
filename: `transfer.${vendor}.js`
},
resolve: {
alias: {
'vue': 'vue/dist/vue.common.js',
'lib': path.resolve(__dirname, './lib'),
'numeric-keyboard': path.resolve(__dirname, `./vendor/${vendor}`)
},
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules|dist/,
use: ['awesome-typescript-loader', 'angular2-template-loader']
},
{
test: /\.js$/,
exclude: /node_modules/,
use: [{ loader: 'babel-loader', options: babelConfig(vendor) }, 'eslint-loader']
},
{
test: /\.component.styl$/,
exclude: /node_modules/,
use: ['to-string-loader', 'css-loader', 'stylus-loader']
},
{
test: /\/\w+(?!\.component\.)\.styl$/,
exclude: /node_modules/,
use: ['style-loader', 'css-loader', 'stylus-loader']
},
{
test: /\.woff$/,
exclude: /node_modules/,
use: ['url-loader']
}
]
},
devtool: 'eval',
devServer: {
host: '0.0.0.0',
port: 4040,
stats: 'minimal'
},
plugins: [
new HtmlWebpackPlugin({
filename: `${vendor}.html`,
template: 'demo/transfer/index.template.html',
meta: { vendor }
})
]
}
}
module.exports = ['vanilla', 'react', 'vue', 'angular'].map(vendor => factory(vendor))