-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
47 lines (45 loc) · 975 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
39
40
41
42
43
44
45
46
47
'use strict'
const path = require('path')
const webpack = require('webpack')
module.exports = {
entry: {
lib: ['./lib/index.js']
},
output: {
path: path.join(__dirname, 'dist'),
filename: process.env.NODE_ENV === 'production' ? 'riot-form.min.js' : 'riot-form.js',
library: 'riotForm',
libraryTarget: 'umd'
},
devtool: 'source-map',
module: {
rules: [{
enforce: 'pre',
test: /\.tag$/,
loader: 'riotjs-loader',
exclude: /node_modules/,
options: { type: 'none' }
}, {
test: /\.js|\.tag/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['es2015'],
plugins: ['transform-runtime']
}
}, {test: /\.html$/, loader: 'html-loader'}]
},
resolve: {
alias: {
'riot-form': path.join(__dirname, './lib')
}
},
externals: {
riot: 'riot'
},
plugins: [
new webpack.ProvidePlugin({
riot: 'riot'
})
]
}