[update]
This commit is contained in:
@@ -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());
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user