|
@@ -4,7 +4,9 @@ import urljoin from 'url-join';
|
|
|
import { Transform } from 'stream';
|
|
import { Transform } from 'stream';
|
|
|
import replaceStream from 'replacestream';
|
|
import replaceStream from 'replacestream';
|
|
|
|
|
|
|
|
-import { cdnLocalScriptRoot, cdnLocalStyleRoot, cdnLocalStyleWebRoot } from '^/config/cdn';
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ cdnLocalScriptRoot, cdnLocalDictRoot, cdnLocalStyleRoot, cdnLocalStyleWebRoot,
|
|
|
|
|
+} from '^/config/cdn';
|
|
|
import * as cdnManifests from '^/resource/cdn-manifests';
|
|
import * as cdnManifests from '^/resource/cdn-manifests';
|
|
|
|
|
|
|
|
import { CdnResource, CdnManifest } from '~/interfaces/cdn';
|
|
import { CdnResource, CdnManifest } from '~/interfaces/cdn';
|
|
@@ -20,11 +22,11 @@ export default class CdnResourcesDownloader {
|
|
|
return { manifest, outDir: cdnLocalScriptRoot };
|
|
return { manifest, outDir: cdnLocalScriptRoot };
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const cdnGzResources: CdnResource[] = cdnManifests.gz.map((manifest: CdnManifest) => {
|
|
|
|
|
- return { manifest, outDir: cdnLocalScriptRoot };
|
|
|
|
|
|
|
+ const cdnDictResources: CdnResource[] = cdnManifests.dict.map((manifest: CdnManifest) => {
|
|
|
|
|
+ return { manifest, outDir: cdnLocalDictRoot };
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const gzExtensionOptions = {
|
|
|
|
|
|
|
+ const dictExtensionOptions = {
|
|
|
ext: 'gz',
|
|
ext: 'gz',
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -40,7 +42,7 @@ export default class CdnResourcesDownloader {
|
|
|
|
|
|
|
|
return Promise.all([
|
|
return Promise.all([
|
|
|
this.downloadScripts(cdnScriptResources),
|
|
this.downloadScripts(cdnScriptResources),
|
|
|
- this.downloadScripts(cdnGzResources, gzExtensionOptions),
|
|
|
|
|
|
|
+ this.downloadScripts(cdnDictResources, dictExtensionOptions),
|
|
|
this.downloadStyles(cdnStyleResources, dlStylesOptions),
|
|
this.downloadStyles(cdnStyleResources, dlStylesOptions),
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|