@dcloudio/uni-cli-shared 3.0.0-alpha-3061020221121002 → 3.0.0-alpha-3061120221128001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hbx/alias.js CHANGED
@@ -16,15 +16,15 @@ const hbxPlugins = {
16
16
  };
17
17
  function initModuleAlias() {
18
18
  const compilerSfcPath = require.resolve('@vue/compiler-sfc');
19
- const serverRendererPath = require.resolve('@vue/server-renderer');
19
+ // const serverRendererPath = require.resolve('@vue/server-renderer')
20
20
  module_alias_1.default.addAliases({
21
21
  '@vue/shared': require.resolve('@vue/shared'),
22
22
  '@vue/shared/dist/shared.esm-bundler.js': require.resolve('@vue/shared/dist/shared.esm-bundler.js'),
23
23
  '@vue/compiler-dom': require.resolve('@vue/compiler-dom'),
24
24
  '@vue/compiler-sfc': compilerSfcPath,
25
- '@vue/server-renderer': serverRendererPath,
25
+ // '@vue/server-renderer': serverRendererPath,
26
26
  'vue/compiler-sfc': compilerSfcPath,
27
- 'vue/server-renderer': serverRendererPath,
27
+ // 'vue/server-renderer': serverRendererPath,
28
28
  });
29
29
  if (process.env.VITEST) {
30
30
  module_alias_1.default.addAliases({
@@ -227,6 +227,7 @@ function sanitizeFileName(name) {
227
227
  * and returns the resolved public URL
228
228
  */
229
229
  function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false, canInline = false) {
230
+ var _a, _b, _c, _d;
230
231
  if (!skipPublicCheck && checkPublicFile(id, config)) {
231
232
  return config.base + id.slice(1);
232
233
  }
@@ -247,11 +248,21 @@ function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false, canI
247
248
  const contentHash = getAssetHash(content);
248
249
  const { search, hash } = (0, url_1.parse)(id);
249
250
  const postfix = (search || '') + (hash || '');
251
+ const output = (_b = (_a = config.build) === null || _a === void 0 ? void 0 : _a.rollupOptions) === null || _b === void 0 ? void 0 : _b.output;
252
+ const defaultAssetFileNames = path_1.default.posix.join(config.build.assetsDir, '[name].[hash][extname]');
253
+ // Steps to determine which assetFileNames will be actually used.
254
+ // First, if output is an object or string, use assetFileNames in it.
255
+ // And a default assetFileNames as fallback.
256
+ let assetFileNames = (_c = (output && !Array.isArray(output) ? output.assetFileNames : undefined)) !== null && _c !== void 0 ? _c : defaultAssetFileNames;
257
+ if (output && Array.isArray(output)) {
258
+ // Second, if output is an array, adopt assetFileNames in the first object.
259
+ assetFileNames = (_d = output[0].assetFileNames) !== null && _d !== void 0 ? _d : assetFileNames;
260
+ }
250
261
  const inputDir = (0, utils_1.normalizePath)(process.env.UNI_INPUT_DIR);
251
- let fileName = file.startsWith(inputDir)
262
+ let fileName = file.startsWith(inputDir) && file.includes('/static/')
252
263
  ? // 需要处理 HBuilderX 项目中的 node_modules 目录
253
264
  (0, utils_3.normalizeNodeModules)(path_1.default.posix.relative(inputDir, file))
254
- : assetFileNamesToFileName(path_1.default.posix.join(config.build.assetsDir, '[name].[hash][extname]'), file, contentHash, content);
265
+ : assetFileNamesToFileName(assetFileNames, file, contentHash, content);
255
266
  if (!map.has(contentHash)) {
256
267
  map.set(contentHash, fileName);
257
268
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3061020221121002",
3
+ "version": "3.0.0-alpha-3061120221128001",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,8 +25,8 @@
25
25
  "@babel/core": "^7.19.6",
26
26
  "@babel/parser": "^7.19.6",
27
27
  "@babel/types": "^7.20.0",
28
- "@dcloudio/uni-i18n": "3.0.0-alpha-3061020221121002",
29
- "@dcloudio/uni-shared": "3.0.0-alpha-3061020221121002",
28
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3061120221128001",
29
+ "@dcloudio/uni-shared": "3.0.0-alpha-3061120221128001",
30
30
  "@intlify/core-base": "9.1.9",
31
31
  "@intlify/shared": "9.1.9",
32
32
  "@intlify/vue-devtools": "9.1.9",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
66
66
  "devDependencies": {
67
- "@dcloudio/uni-uts-v1": "3.0.0-alpha-3061020221121002",
67
+ "@dcloudio/uni-uts-v1": "3.0.0-alpha-3061120221128001",
68
68
  "@types/babel__core": "^7.1.19",
69
69
  "@types/debug": "^4.1.7",
70
70
  "@types/estree": "^0.0.51",