diff --git a/docs/compiled/i18n/ar.js b/docs/compiled/i18n/ar.js new file mode 100644 index 000000000..df699e26a --- /dev/null +++ b/docs/compiled/i18n/ar.js @@ -0,0 +1 @@ +!function(e,t,n,r,o,i,l,u){var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},d="function"==typeof f[r]&&f[r],a=d.i||{},c=d.cache||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!c[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof f[r]&&f[r];if(!n&&i)return i(t,!0);if(d)return d(t,!0);if(s&&"string"==typeof t)return s(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}a.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},a.cache={};var u=c[t]=new p.Module(t);e[t][0].call(u.exports,a,u,u.exports,f)}return c[t].exports;function a(e){var t=a.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=s,this.exports={}},p.modules=e,p.cache=c,p.parent=d,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=a,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return f[r]}}),f[r]=p;for(var y=0;y + + + + + Artplayer with i18n + + + + +
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/build-i18n.js b/scripts/build-i18n.js index 689d97e7a..e0870210f 100644 --- a/scripts/build-i18n.js +++ b/scripts/build-i18n.js @@ -2,11 +2,13 @@ import fs from 'node:fs' import path from 'node:path' import process from 'node:process' import { Parcel } from '@parcel/core' +import cpy from 'cpy' import { glob } from 'glob' const basePath = 'packages/artplayer' const i18nSrcDir = path.join(basePath, 'src/i18n') const distDir = path.join(basePath, 'dist/i18n') +const compiledPath = path.resolve('docs/compiled/i18n') const entries = glob.sync('*.js', { cwd: i18nSrcDir, @@ -42,7 +44,7 @@ const entries = glob.sync('*.js', { const { bundleGraph, buildTime } = await bundler.run() const bundles = bundleGraph.getBundles() console.log(`✨ Built [i18n] ${bundles.length} bundles in ${buildTime}ms`) - bundles.forEach(b => console.log('📦 Output:', b.filePath)) + await cpy(distDir, compiledPath) } catch (err) { console.error('❌ Build i18n failed.')