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

fix(mp): typescript

上级 2fd66fae
...@@ -8,11 +8,11 @@ const { ...@@ -8,11 +8,11 @@ const {
getPartialIdentifier getPartialIdentifier
} = require('./util') } = require('./util')
function resolve(dir) { function resolve (dir) {
return path.resolve(__dirname, '..', dir) return path.resolve(__dirname, '..', dir)
} }
module.exports = function chainWebpack(platformOptions, vueOptions, api) { module.exports = function chainWebpack (platformOptions, vueOptions, api) {
const { const {
runByHBuilderX, // 使用 HBuilderX 运行 runByHBuilderX, // 使用 HBuilderX 运行
cssPreprocessOptions cssPreprocessOptions
...@@ -154,8 +154,8 @@ module.exports = function chainWebpack(platformOptions, vueOptions, api) { ...@@ -154,8 +154,8 @@ module.exports = function chainWebpack(platformOptions, vueOptions, api) {
.delete('@') .delete('@')
.set( .set(
'@/pages.json', '@/pages.json',
path.resolve(process.env.UNI_INPUT_DIR, 'pages.json') path.resolve(process.env.UNI_INPUT_DIR, 'pages.json') +
+ '?' + JSON.stringify({ '?' + JSON.stringify({
type: 'origin-pages-json' type: 'origin-pages-json'
}) })
) )
......
...@@ -189,7 +189,9 @@ module.exports = { ...@@ -189,7 +189,9 @@ module.exports = {
? process.env.UNI_MP_PLUGIN_MAIN ? process.env.UNI_MP_PLUGIN_MAIN
: JSON.parse(process.env.UNI_MP_PLUGIN_EXPORT) : JSON.parse(process.env.UNI_MP_PLUGIN_EXPORT)
).forEach(fileName => addToUniEntry(fileName)) ).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 const alias = { // 仅 mp-weixin
...@@ -218,8 +220,7 @@ module.exports = { ...@@ -218,8 +220,7 @@ module.exports = {
output.pathinfo = false output.pathinfo = false
} }
return { return {
mode: process.env.NODE_ENV === 'production' ? 'production' mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
: 'development',
entry () { entry () {
return process.UNI_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 const isAlipay = window.my && navigator.userAgent.indexOf(AC.reverse().join('')) > -1
export function initWebviewApi (readyCallback) { export function initWebviewApi (readyCallback) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册