Skip to content

Commit

Permalink
test: test proxy project
Browse files Browse the repository at this point in the history
  • Loading branch information
Luobinf committed Dec 5, 2023
1 parent 1a44d0d commit 0d57d99
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
9 changes: 4 additions & 5 deletions packages/webpack-plugin/lib/web/processMainScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ module.exports = function (script, {

let output = `\n import { processAppOption, getComponent } from ${stringifyRequest(loaderContext, optionProcessorPath)}
import '@mpxjs/webpack-plugin/lib/runtime/base.styl'
// import Vue from 'vue'
import { createApp } from 'vue'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Mpx from '@mpxjs/core'
import App from ${stringifyRequest(loaderContext, addQuery(resource, { isApp: true }))}
// Vue.use(VueRouter)
\n`

if (i18n) {
output += buildI18n({ i18n, loaderContext })
}
// if (i18n) {
// output += buildI18n({ i18n, loaderContext })
// }

output += buildGlobalParams({ moduleId, scriptSrcMode, loaderContext, isProduction, jsonConfig, webConfig, isMain: true, globalTabBar })
output += `export default processAppOption({
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/proxy-miniprogram-project/copySh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ echo "start copy"

rm -rf ./node_modules/@mpxjs/core
rm -rf ./node_modules/@mpxjs/utils
rm -rf ./node_modules/@mpxjs/webpack-plugin/lib
rm -rf ./node_modules/@mpxjs/api-proxy/src

scp -r ../../../packages/core ./node_modules/@mpxjs/core
scp -r ../../../packages/utils ./node_modules/@mpxjs/utils
scp -r ../../../packages/webpack-plugin/lib/ ./node_modules/@mpxjs/webpack-plugin/lib/
scp -r ../../../packages/api-proxy/src/ ./node_modules/@mpxjs/api-proxy/src/

echo "end copy"
6 changes: 3 additions & 3 deletions test/e2e/proxy-miniprogram-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"@mpxjs/pinia": "^2.8.0",
"@mpxjs/store": "^2.8.0",
"@mpxjs/utils": "^2.8.0",
"@mpxjs/webpack-plugin": "^2.9.3",
"vue": "^2.7.10",
"vue": "^3.2.36",
"vue-demi": "^0.13.11",
"vue-i18n": "^8.27.2",
"vue-i18n-bridge": "^9.2.2"
Expand All @@ -44,6 +43,7 @@
"@mpxjs/miniprogram-simulate": "^1.4.12",
"@mpxjs/mpx-jest": "0.0.18",
"@mpxjs/size-report": "^2.8.0",
"@mpxjs/webpack-plugin": "^2.9.3",
"@types/jest": "^27.5.1",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
Expand Down Expand Up @@ -74,7 +74,7 @@
"ts-jest": "^27.1.2",
"ts-loader": "^9.2.6",
"typescript": "^4.1.2",
"vue-loader": "^15.9.3",
"vue-loader": "^17.3.1",
"vue-router": "^3.1.3",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.10",
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/proxy-miniprogram-project/src/app.mpx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import mpx, { createApp } from '@mpxjs/core'
import apiProxy from '@mpxjs/api-proxy'
// import apiProxy from '@mpxjs/api-proxy'

mpx.use(apiProxy, { usePromise: true })
// mpx.use(apiProxy, { usePromise: true })

createApp({
onLaunch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"setting": {
"newFeature": true,
"urlCheck": true,
"es6": false,
"es6": true,
"postcss": false,
"minified": false,
"checkSiteMap": false,
Expand All @@ -12,7 +12,8 @@
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"enhance": true
},
"appid": "wx39f7201a9da13e5a",
"projectname": "proxy-miniprogram-project",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "proxy-miniprogram-project",
"setting": {
"compileHotReLoad": true
"compileHotReLoad": true,
"urlCheck": false
}
}

0 comments on commit 0d57d99

Please sign in to comment.