@dcloudio/vue-cli-plugin-uni 2.0.1-33420211228002 → 2.0.1-33420211228004

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.
@@ -69,12 +69,14 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
69
69
 
70
70
  const tsConfigJsonFile = fs.existsSync(userTsConfigJson) ? userTsConfigJson : defaultTsConfigJson
71
71
 
72
+ const context = isInHBuilderX ? process.env.UNI_INPUT_DIR : process.env.UNI_CLI_CONTEXT
73
+
72
74
  const tsLoaderOptions = {
73
- context: process.env.UNI_INPUT_DIR,
75
+ context,
74
76
  configFile: tsConfigJsonFile,
75
77
  transpileOnly: false,
76
78
  compilerOptions: {
77
- baseUrl: process.env.UNI_INPUT_DIR,
79
+ baseUrl: context,
78
80
  typeRoots: [resolveModule('@dcloudio/types'), resolveModule('@types')],
79
81
  types: [
80
82
  'uni-app',
@@ -302,7 +304,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
302
304
  const resolveLoaderAlias = {}
303
305
  const modules = ['@vue/cli-plugin-babel', '@vue/cli-service']
304
306
  modules.forEach(m => {
305
- const { dependencies } = require(`${m}/package.json`)
307
+ const {
308
+ dependencies
309
+ } = require(`${m}/package.json`)
306
310
  Object.keys(dependencies).forEach(key => {
307
311
  if (/-loader$/.test(key)) {
308
312
  resolveLoaderAlias[key] = require.resolve(key)
@@ -350,4 +354,4 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
350
354
  watchOptions: require('./util').getWatchOptions()
351
355
  }, platformWebpackConfig)
352
356
  }
353
- }
357
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.1-33420211228002",
3
+ "version": "2.0.1-33420211228004",
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.1-33420211228002",
20
+ "@dcloudio/uni-stat": "^2.0.1-33420211228004",
21
21
  "buffer-json": "^2.0.0",
22
22
  "copy-webpack-plugin": "^5.1.1",
23
23
  "cross-env": "^5.2.0",
@@ -37,5 +37,5 @@
37
37
  "wrap-loader": "^0.2.0",
38
38
  "xregexp": "4.0.0"
39
39
  },
40
- "gitHead": "638b12e8f1886590d8f16562c14240c354a66bb2"
40
+ "gitHead": "46925c288cdb3a955c9eb78de2972d94b2f8d249"
41
41
  }
@@ -41,10 +41,11 @@ const matchCss = /\.css$/i;
41
41
  const fs = require('fs')
42
42
  const preprocessor = require('../../webpack-preprocess-loader/preprocess/lib/preprocess')
43
43
  const {
44
- cssPreprocessOptions
44
+ cssPreprocessOptions,
45
+ nvueCssPreprocessOptions
45
46
  } = require('@dcloudio/uni-cli-shared')
46
-
47
- function webpackImporter(resourcePath, resolve, addNormalizedDependency) {
47
+ // fixed by xxxxxx
48
+ function webpackImporter(resourcePath, resolve, addNormalizedDependency, isNVue) {
48
49
  function dirContextFrom(fileContext) {
49
50
  return _path.default.dirname( // The first file is 'stdin' when we're using the data option
50
51
  fileContext === 'stdin' ? resourcePath : fileContext);
@@ -63,7 +64,7 @@ function webpackImporter(resourcePath, resolve, addNormalizedDependency) {
63
64
  if (contents.includes('#endif')) {
64
65
  return {
65
66
  file,
66
- contents: preprocessor.preprocess(contents, cssPreprocessOptions.context, {
67
+ contents: preprocessor.preprocess(contents, isNVue ? nvueCssPreprocessOptions.context : cssPreprocessOptions.context, {
67
68
  type: cssPreprocessOptions.type
68
69
  })
69
70
  }
@@ -112,7 +112,8 @@ module.exports = function (source, map) {
112
112
  ? 'import \'@dcloudio/uni-app-plus/dist/automator.view\''
113
113
  : ''
114
114
  this.callback(null,
115
- `
115
+ `
116
+ // @ts-nocheck
116
117
  import 'uni-pages?${JSON.stringify({ type: 'view' })}'
117
118
  ${automatorCode}
118
119
  function initView(){