diff --git a/plugins/add-vendors-plugin.js b/plugins/add-vendors-plugin.js index e2b560f..bbcb610 100644 --- a/plugins/add-vendors-plugin.js +++ b/plugins/add-vendors-plugin.js @@ -1,5 +1,3 @@ -const { ConcatSource } = require('webpack-sources') - module.exports = class AddVendorsPlugin { constructor (base) { this.base = base @@ -14,11 +12,9 @@ module.exports = class AddVendorsPlugin { const vendor = compilation.assets[`vendors.${this.base}`] if (main && vendor) { - const compiledAsset = new ConcatSource(main._value[0]) - compiledAsset.add(vendor) - compiledAsset.add(main._value[1]) + main.add(vendor) compilation.assets = {} - compilation.assets[this.base] = compiledAsset + compilation.assets[this.base] = main } else if (main && mainMap) { compilation.assets = {} compilation.assets[this.base] = main diff --git a/scripts/hash_fingerprint_contents.js b/scripts/hash_fingerprint_contents.js index ca34dda..94fe275 100644 --- a/scripts/hash_fingerprint_contents.js +++ b/scripts/hash_fingerprint_contents.js @@ -1,7 +1,7 @@ 'use strict' -const base64url = require('../src/util/base64url') const crypto = require('crypto') +const base64url = require('../src/util/base64url') const fingerprintContents = Buffer.from(process.argv[2], 'base64') diff --git a/webpack.common.js b/webpack.common.js index 6e1fcb1..162b718 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -35,7 +35,7 @@ module.exports = { }, optimization: { minimize: true, - noEmitOnErrors: true + emitOnErrors: false }, resolve: { extensions: ['.js'], diff --git a/webpack.config.js b/webpack.config.js index 2595582..a4ae834 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -21,9 +21,6 @@ const OVERRIDES = { // optimization: { // minimize: false // } - node: { - global: true - } } if (PRODUCTION) { diff --git a/webpack.parts.js b/webpack.parts.js index ccf59e2..40a67bc 100644 --- a/webpack.parts.js +++ b/webpack.parts.js @@ -11,14 +11,14 @@ const production = require('./webpack.production.js') const AddVendorsPlugin = require('./plugins/add-vendors-plugin') const paths = { - entry: path.resolve(__dirname, './src/index.js'), + entry: path.resolve(__dirname, 'src/index.js'), bundle: path.resolve(__dirname, 'dist/browser') } const outputs = (base, env, mapping, overrides) => { const collection = [] const library = 'CryptoConditions' - const windowLibrary = 'CryptoConditions' + // const windowLibrary = 'CryptoConditions' const environment = env === 'production' ? production : development const ext = env === 'production' ? 'min.js' : 'js' @@ -29,7 +29,8 @@ const outputs = (base, env, mapping, overrides) => { const compiled = { output: { filename: filename, - library: target === 'window' ? windowLibrary : library, + // setting library mess up with export + // library: target === 'window' ? windowLibrary : library, libraryTarget: target, path: paths.bundle },