[add] code

This commit is contained in:
2025-07-21 17:01:43 +01:00
parent d564cf2cd1
commit 5b584a90a5
10 changed files with 215 additions and 698 deletions

View File

@@ -2,25 +2,39 @@ import wp from 'webpack';
import path from 'node:path'
const outputPath = path.resolve('./output/');
console.log(outputPath);
const l = 'classnames'
const libraryLocation = import.meta.resolve(l);
console.log(libraryLocation);
// throw Error("5");
const compiler = wp({
entry:'./test_src/arithmetic.cjs',
entry:libraryLocation,
mode: 'production',
optimization:{
mangleExports: false,
avoidEntryIife: true,
minimize: false
},
// experiments:{}
output: {
path: outputPath,
filename: 'lodash.bundle.js',
scriptType: 'module',
filename: l+'.bundle.cjs',
clean: true,
iife: false,
library: {
type: 'commonjs2',
// name: l
}
// module: true
}
,
},(err,stats)=>{
if (err || stats.hasErrors()) {
console.log(stats.hasErrors())
console.log(err?.stack)
console.log(stats.toJson());
console.log(stats?.hasErrors())
console.log(stats?.toJson());
}
})