forked from xixilive/weapp-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (39 loc) · 875 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
var path = require('path')
var webpack = require('webpack')
var pkg = require('./package.json')
module.exports = {
devtool: null,
context: path.join(__dirname, 'es6'),
entry: {
'index': './index',
'promise': './promise'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'umd'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
include: path.join(__dirname, 'es6'),
exclude: path.join(__dirname, 'node_modules')
}
]
},
resolve: {
extensions: ['', '.js'],
modulesDirectories: ['es6', 'node_modules']
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
'VERSION': JSON.stringify(pkg.version),
'API_VERSION': JSON.stringify(pkg.apiVersion)
}
})
]
}