1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-12-26 14:47:51 +01:00

chore: update wepback config

declare Buffer as webpack plugin
This commit is contained in:
getlarge 2022-02-15 08:06:05 +01:00
parent 1f95bec2be
commit 34289b0640
No known key found for this signature in database
GPG Key ID: E4E13243600F9566
5 changed files with 15 additions and 9 deletions

View File

@ -2,7 +2,6 @@
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
// Code is Apache-2.0 and docs are CC-BY-4.0
import { Buffer } from 'buffer'
import stableStringify from 'json-stable-stringify'
import clone from 'clone'
import base58 from 'bs58'

View File

@ -6,7 +6,8 @@
'use strict'
const { paths } = require('./webpack.parts.js')
const { ProvidePlugin } = require('webpack')
const { paths } = require('./webpack.parts')
module.exports = {
entry: paths.entry,
@ -24,10 +25,18 @@ module.exports = {
},
optimization: {
minimize: true,
noEmitOnErrors: true
emitOnErrors: false
},
resolve: {
extensions: ['.js'],
modules: ['node_modules'],
fallback: {
buffer: require.resolve('buffer/'),
}
},
plugins: [
new ProvidePlugin({
Buffer: ['buffer', 'Buffer']
})
]
}

View File

@ -8,9 +8,9 @@
const PRODUCTION = process.env.NODE_ENV === 'production'
const common = require('./webpack.common.js')
const common = require('./webpack.common')
const { outputs } = require('./webpack.parts.js')
const { outputs } = require('./webpack.parts')
// '[libraryTarget]': [file extension]
const OUTPUT_MAPPING = {

View File

@ -14,11 +14,9 @@ module.exports = {
minimizer: [
new TerserPlugin({
test: /vendor/,
sourceMap: false
}),
new TerserPlugin({
test: /^((?!(vendor)).)*.js$/,
sourceMap: false
})
],
splitChunks: {

View File

@ -9,8 +9,8 @@
const path = require('path')
const { merge } = require('webpack-merge')
const development = require('./webpack.development.js')
const production = require('./webpack.production.js')
const development = require('./webpack.development')
const production = require('./webpack.production')
const AddVendorsPlugin = require('./plugins/add-vendors-plugin')