fix jszip for production
This commit is contained in:
parent
e12f498afa
commit
9674b50be0
10 changed files with 64 additions and 21 deletions
7
bin/webpack-jszip-bundle.js
Normal file
7
bin/webpack-jszip-bundle.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import * as JSZip from "../node_modules/jszip/dist/jszip.js";
|
||||
|
||||
export default JSZip;
|
||||
|
||||
export {
|
||||
JSZip
|
||||
};
|
||||
38
bin/webpack-jszip-esm.js
Normal file
38
bin/webpack-jszip-esm.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: path.resolve(__dirname, './webpack-jszip-bundle.js'),
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../src/ext'),
|
||||
filename: 'jszip-esm.js',
|
||||
library: {
|
||||
type: 'module'
|
||||
},
|
||||
module: true
|
||||
},
|
||||
experiments: {
|
||||
outputModule: true
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.mjs', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
resolve: {
|
||||
fullySpecified: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
optimization: {
|
||||
minimize: false
|
||||
},
|
||||
performance: {
|
||||
hints: false,
|
||||
maxAssetSize: 2 * 1024 * 1024,
|
||||
maxEntrypointSize: 2 * 1024 * 1024,
|
||||
},
|
||||
};
|
||||
Loading…
Reference in a new issue