Skip to content

Commit

Permalink
Merge branch 'dev' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
zhetengbiji committed Jun 14, 2022
2 parents 5fdc53d + b05eafc commit b4c9370
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/vue-cli-plugin-hbuilderx/module-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ moduleAlias.addAlias('@vue/component-compiler-utils/package.json', require.resol
'@dcloudio/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/package.json'))

if (isInHBuilderX) {
moduleAlias.addAlias('typescript', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
'compile-typescript/node_modules/typescript'))
moduleAlias.addAlias('less', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
'compile-less/node_modules/less'))
moduleAlias.addAlias('node-sass', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
Expand Down
8 changes: 4 additions & 4 deletions packages/vue-cli-plugin-uni/lib/chain-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const {
getPartialIdentifier
} = require('./util')

function resolve(dir) {
function resolve (dir) {
return path.resolve(__dirname, '..', dir)
}

module.exports = function chainWebpack(platformOptions, vueOptions, api) {
module.exports = function chainWebpack (platformOptions, vueOptions, api) {
const {
runByHBuilderX, // 使用 HBuilderX 运行
cssPreprocessOptions
Expand Down Expand Up @@ -154,8 +154,8 @@ module.exports = function chainWebpack(platformOptions, vueOptions, api) {
.delete('@')
.set(
'@/pages.json',
path.resolve(process.env.UNI_INPUT_DIR, 'pages.json')
+ '?' + JSON.stringify({
path.resolve(process.env.UNI_INPUT_DIR, 'pages.json') +
'?' + JSON.stringify({
type: 'origin-pages-json'
})
)
Expand Down
7 changes: 4 additions & 3 deletions packages/vue-cli-plugin-uni/lib/mp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ module.exports = {
? process.env.UNI_MP_PLUGIN_MAIN
: JSON.parse(process.env.UNI_MP_PLUGIN_EXPORT)
).forEach(fileName => addToUniEntry(fileName))
beforeCode += `${globalEnv}.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;`
beforeCode += `
// @ts-ignore
${globalEnv}.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;`
}

const alias = { // 仅 mp-weixin
Expand Down Expand Up @@ -218,8 +220,7 @@ module.exports = {
output.pathinfo = false
}
return {
mode: process.env.NODE_ENV === 'production' ? 'production'
: 'development',
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry () {
return process.UNI_ENTRY
},
Expand Down

0 comments on commit b4c9370

Please sign in to comment.