forked from MONEI/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack-config.js
More file actions
35 lines (35 loc) · 929 Bytes
/
webpack-config.js
File metadata and controls
35 lines (35 loc) · 929 Bytes
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
const webpack = require('webpack');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = function (context, options) {
const isProd = process.env.NODE_ENV === 'production';
return {
name: 'webpack-config',
configureWebpack(config, isServer, utils) {
return {
resolve: {
fallback: {
path: require.resolve('path-browserify'),
http: false,
fs: false,
os: false
}
},
module: {
rules: [
{
test: /\.js/,
include: /node_modules\/yaml\/browser/,
type: 'javascript/auto'
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.versions.node': JSON.stringify(process.versions.node || '0.0.0')
}),
new NodePolyfillPlugin()
]
};
}
};
};