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:
parent
1f95bec2be
commit
34289b0640
@ -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'
|
||||
|
@ -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']
|
||||
})
|
||||
]
|
||||
}
|
||||
|
@ -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 = {
|
||||
|
@ -14,11 +14,9 @@ module.exports = {
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
test: /vendor/,
|
||||
sourceMap: false
|
||||
}),
|
||||
new TerserPlugin({
|
||||
test: /^((?!(vendor)).)*.js$/,
|
||||
sourceMap: false
|
||||
})
|
||||
],
|
||||
splitChunks: {
|
||||
|
@ -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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user