This commit is contained in:
2025-07-26 13:44:32 +01:00
parent 5b584a90a5
commit 2d02acacc7
24 changed files with 4519 additions and 77 deletions

View File

@@ -3,38 +3,58 @@ 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);
const ls = [
'classnames',
'semver',
'ansi-styles',
'debug',
'supports-color',
'chalk',
'ms',
'minimatch',
'strip-ansi',
'tslib',
'has-flag',
'ansi-regex',
'color-convert',
'color-name',
// 'type-fest',
'string-width'
]
// throw Error("5");
const compiler = wp({
entry:libraryLocation,
mode: 'production',
optimization:{
mangleExports: false,
avoidEntryIife: true,
minimize: false
},
// experiments:{}
output: {
path: outputPath,
filename: l+'.bundle.cjs',
clean: true,
iife: false,
library: {
type: 'commonjs2',
// name: l
ls.forEach(l=>{
const libraryLocation = import.meta.resolve(l);
console.log(libraryLocation);
// throw Error("5");
wp({
entry:libraryLocation,
mode: 'production',
optimization:{
mangleExports: false,
avoidEntryIife: true,
minimize: false
},
output: {
path: outputPath,
filename: l+'.bundle.cjs',
clean: false,
iife: false,
library: {
type: 'commonjs2',
// name: l
}
// module: true
}
// module: true
}
,
},(err,stats)=>{
if (err || stats.hasErrors()) {
console.log(err?.stack)
console.log(stats?.hasErrors())
console.log(stats?.toJson());
}
,
},(err,stats)=>{
if (err || stats.hasErrors()) {
console.log(err?.stack)
console.log(stats?.hasErrors())
console.log(stats?.toJson());
}
})
})