提交 6e8fa8d9 编写于 作者: fxy060608's avatar fxy060608

fix(mp): typescript

上级 2fd66fae
......@@ -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
......@@ -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'
})
)
......
......@@ -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
......@@ -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
},
......
const AC = ['t', 'n', 'e', 'i', 'l', 'C', 'y', 'a', 'p', 'i', 'l', 'A'];
const AC = ['t', 'n', 'e', 'i', 'l', 'C', 'y', 'a', 'p', 'i', 'l', 'A']
const isAlipay = window.my && navigator.userAgent.indexOf(AC.reverse().join('')) > -1
export function initWebviewApi (readyCallback) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册