-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
32 lines (30 loc) · 947 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
var webpack = require('webpack');
var isProd = (process.env.NODE_ENV === 'production');
// minimize only in production
var plugins = isProd ? [new webpack.optimize.UglifyJsPlugin({minimize: true })] : []
module.exports = {
entry: './index.js',
// source map not in production
devtool: !isProd && 'source-map',
output: {
filename: __dirname + '/dist/build.js',
libraryTarget: 'umd'
},
externals: {
"remotestoragejs": {
root: "RemoteStorage", // <script src='remotestorage.js'> will resolve in this.RemoteStorage
commonjs2: "remotestoragejs", // require('remotestoragejs')
commonjs: "remotestoragejs", // require('remotestoragejs')
amd: "remotestoragejs" // define(['remotestoragejs'], ...)
}
},
module: {
loaders: [
{ test: /\.js$/, exclude: '/node_modules|dist/', loader: 'babel?presets[]=es2015' },
]
},
resolve: {
extensions: ['', '.js']
},
plugins: plugins
};