1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-06 20:10:05 +00:00

fix(build): add node polyfill plugin and stub fs and readline when building for the browser

This commit is contained in:
Krishna Acondy
2021-07-01 09:11:03 +01:00
parent 5d77bbba8b
commit 5a35237de5
3 changed files with 2073 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
const path = require('path')
const webpack = require('webpack')
const terserPlugin = require('terser-webpack-plugin')
const nodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const defaultPlugins = [
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/),
@@ -37,7 +38,7 @@ const browserConfig = {
},
resolve: {
extensions: ['.ts', '.js'],
fallback: { https: false }
fallback: { https: false, fs: false, readline: false }
},
output: {
filename: 'index.js',
@@ -49,7 +50,8 @@ const browserConfig = {
...defaultPlugins,
new webpack.ProvidePlugin({
process: 'process/browser'
})
}),
new nodePolyfillPlugin()
]
}