mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-12-27 23:27:50 +01:00
34289b0640
declare Buffer as webpack plugin
35 lines
824 B
JavaScript
35 lines
824 B
JavaScript
// Copyright BigchainDB GmbH and BigchainDB contributors
|
|
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
|
// Code is Apache-2.0 and docs are CC-BY-4.0
|
|
|
|
/* eslint-disable strict, no-console, object-shorthand */
|
|
|
|
'use strict'
|
|
|
|
const PRODUCTION = process.env.NODE_ENV === 'production'
|
|
|
|
const common = require('./webpack.common')
|
|
|
|
const { outputs } = require('./webpack.parts')
|
|
|
|
// '[libraryTarget]': [file extension]
|
|
const OUTPUT_MAPPING = {
|
|
'amd': 'amd',
|
|
'commonjs': 'cjs',
|
|
'commonjs2': 'cjs2',
|
|
'umd': 'umd',
|
|
'window': 'window',
|
|
}
|
|
|
|
const OVERRIDES = {
|
|
// optimization: {
|
|
// minimize: false
|
|
// }
|
|
}
|
|
|
|
if (PRODUCTION) {
|
|
module.exports = outputs(common, 'production', OUTPUT_MAPPING, OVERRIDES)
|
|
} else {
|
|
module.exports = outputs(common, 'development', OUTPUT_MAPPING, OVERRIDES)
|
|
}
|