mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-11-21 17:26:56 +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)
|
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
// Code is Apache-2.0 and docs are 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 stableStringify from 'json-stable-stringify'
|
||||||
import clone from 'clone'
|
import clone from 'clone'
|
||||||
import base58 from 'bs58'
|
import base58 from 'bs58'
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { paths } = require('./webpack.parts.js')
|
const { ProvidePlugin } = require('webpack')
|
||||||
|
const { paths } = require('./webpack.parts')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: paths.entry,
|
entry: paths.entry,
|
||||||
@ -24,10 +25,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
noEmitOnErrors: true
|
emitOnErrors: false
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js'],
|
extensions: ['.js'],
|
||||||
modules: ['node_modules'],
|
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 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]
|
// '[libraryTarget]': [file extension]
|
||||||
const OUTPUT_MAPPING = {
|
const OUTPUT_MAPPING = {
|
||||||
|
@ -14,11 +14,9 @@ module.exports = {
|
|||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
test: /vendor/,
|
test: /vendor/,
|
||||||
sourceMap: false
|
|
||||||
}),
|
}),
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
test: /^((?!(vendor)).)*.js$/,
|
test: /^((?!(vendor)).)*.js$/,
|
||||||
sourceMap: false
|
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const { merge } = require('webpack-merge')
|
const { merge } = require('webpack-merge')
|
||||||
|
|
||||||
const development = require('./webpack.development.js')
|
const development = require('./webpack.development')
|
||||||
const production = require('./webpack.production.js')
|
const production = require('./webpack.production')
|
||||||
|
|
||||||
const AddVendorsPlugin = require('./plugins/add-vendors-plugin')
|
const AddVendorsPlugin = require('./plugins/add-vendors-plugin')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user