@dcloudio/vue-cli-plugin-uni 2.0.2-3090920231225001 → 2.0.2-4000620240325001

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.
@@ -31,17 +31,17 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
31
31
  }
32
32
  if (newOptions.fallback && newOptions.fallback.options) {
33
33
  const generator = {}
34
- const oldOptions = newOptions.fallback.options
35
- const keys = ['publicPath', 'outputPath']
36
- keys.forEach(key => {
37
- generator[key] = pathData => {
38
- const outputPath = oldOptions[key](null, pathData.module.request)
39
- const basename = path.basename(outputPath)
40
- return outputPath.substring(0, outputPath.length - basename.length)
41
- }
42
- })
34
+ const options = newOptions.fallback.options
35
+ // const keys = ['publicPath', 'outputPath']
36
+ // keys.forEach(key => {
37
+ // generator[key] = pathData => {
38
+ // const outputPath = oldOptions[key](null, pathData.module.request)
39
+ // const basename = path.basename(outputPath)
40
+ // return outputPath.substring(0, outputPath.length - basename.length)
41
+ // }
42
+ // })
43
43
  generator.filename = pathData => {
44
- return path.basename(pathData.module.request)
44
+ return options.name(pathData.module.request)
45
45
  }
46
46
  webpackConfig.module.rule(staticType).set('generator', generator)
47
47
  }
@@ -94,16 +94,28 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
94
94
 
95
95
  const tsLoaderOptions = require('./util').getTsLoadOptions()
96
96
 
97
- function updateTsLoader (rawRules, fakeFile, loader) {
97
+ function updateTsLoader (rawRules, fakeFile, loader, appendUTS = false) {
98
98
  const matchRule = rawRules.find(createMatcher(fakeFile))
99
99
  if (matchRule && matchRule.use) {
100
100
  if (isInHBuilderX) {
101
101
  matchRule.use.forEach(matchUse => {
102
102
  if (matchUse.loader.includes('ts-loader')) {
103
103
  Object.assign(matchUse.options, tsLoaderOptions)
104
+ if (appendUTS) {
105
+ if (!Array.isArray(matchUse.options.appendTsSuffixTo)) {
106
+ matchUse.options.appendTsSuffixTo = [matchUse.options.appendTsSuffixTo]
107
+ }
108
+ matchUse.options.appendTsSuffixTo.push(/\.uts$/)
109
+ }
104
110
  }
105
111
  })
106
112
  }
113
+ if (appendUTS) {
114
+ if (!Array.isArray(matchRule.test)) {
115
+ matchRule.test = [matchRule.test]
116
+ }
117
+ matchRule.test.push(/\.uts$/)
118
+ }
107
119
  matchRule.use.push(loader)
108
120
  }
109
121
  }
@@ -160,7 +172,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
160
172
  updateTsLoader(rawRules, 'foo.ts', {
161
173
  loader: resolve('packages/webpack-preprocess-loader'),
162
174
  options: jsPreprocessOptions
163
- })
175
+ }, true)
164
176
  updateTsLoader(rawRules, 'foo.tsx', {
165
177
  loader: resolve('packages/webpack-preprocess-loader'),
166
178
  options: jsPreprocessOptions
package/lib/h5/index.js CHANGED
@@ -194,4 +194,4 @@ module.exports = {
194
194
  require('./cssnano-options')(webpackConfig)
195
195
  }
196
196
  }
197
- }
197
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.2-3090920231225001",
3
+ "version": "2.0.2-4000620240325001",
4
4
  "description": "uni-app plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "author": "fxy060608",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcloudio/uni-stat": "^2.0.2-3090920231225001",
20
+ "@dcloudio/uni-stat": "^2.0.2-4000620240325001",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "cross-env": "^5.2.0",
@@ -41,5 +41,5 @@
41
41
  "copy-webpack-plugin": ">=5",
42
42
  "postcss": ">=7"
43
43
  },
44
- "gitHead": "930c6d04bc26067ed5f7b8a1e782ad43760509fd"
44
+ "gitHead": "2f9ba8ff3e3f185745faa67dd4eefaef7f3db374"
45
45
  }