mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
1 parent
9ba838aa52
commit
e71a683dfd
38 files changed
+12194
-9690
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import path from 'path';
|
||||
import { glob } from 'glob';
|
||||
import { Parcel } from '@parcel/core';
|
||||
|
||||
const basePath = 'packages/artplayer/src/i18n';
|
||||
const entries = glob.sync(
|
||||
path.join(basePath, '*.js'),
|
||||
{
|
||||
ignore: [
|
||||
path.join(basePath, 'index.js'),
|
||||
path.join(basePath, 'zh-cn.js'),
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
(async function build() {
|
||||
const bundler = new Parcel({
|
||||
entries: entries,
|
||||
defaultConfig: '@parcel/config-default',
|
||||
mode: 'production',
|
||||
defaultTargetOptions: {
|
||||
distDir: 'packages/artplayer/dist/i18n',
|
||||
sourceMaps: false,
|
||||
outputFormat: 'global',
|
||||
isLibrary: true,
|
||||
engines: {
|
||||
browsers: ['last 1 Chrome version'],
|
||||
},
|
||||
},
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
const { bundleGraph, buildTime } = await bundler.run();
|
||||
const bundles = bundleGraph.getBundles();
|
||||
console.log(`✨ Built ${bundles.length} bundles in ${buildTime}ms`);
|
||||
} catch (err) {
|
||||
console.log(err.diagnostics);
|
||||
}
|
||||
})();
|
||||
Reference in new issue
Block a user