mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-19 18:54:06 -04:00
fix(build): polyfill Buffer internally
This commit is contained in:
parent
c5fc76a3ee
commit
b8371aded1
1 changed files with 11 additions and 1 deletions
|
@ -2,6 +2,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|||
const defaultsDeep = require('lodash.defaultsdeep');
|
||||
const path = require('path');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
const base = {
|
||||
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
||||
|
@ -11,6 +12,11 @@ const base = {
|
|||
libraryTarget: 'umd',
|
||||
filename: '[name].js'
|
||||
},
|
||||
resolve: {
|
||||
fallback: {
|
||||
Buffer: require.resolve('buffer/')
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.js$/,
|
||||
|
@ -32,7 +38,11 @@ const base = {
|
|||
})
|
||||
]
|
||||
},
|
||||
plugins: []
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
Buffer: ['buffer', 'Buffer']
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue