-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (31 loc) · 962 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
const webpack = require("webpack");
console.log("Node ENV:", process.env.NODE_ENV);
module.exports = {
entry: "./dist/index.js",
output: {
path: __dirname + "/browser/",
filename: 'pio.' + (process.env.NODE_ENV === "production" ? "prod" : "dev") + '.js',
library: {
name: "PIO",
type: "umd",
}
},
resolve: {
fallback: {
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
process: require.resolve('process/browser'),
stream: require.resolve('stream-browserify'),
zlib: require.resolve('browserify-zlib'),
}
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.ProvidePlugin({
process: 'process/browser'
})
],
mode: process.env.NODE_ENV === "production" ? "production" : "development"
};