提交 36fb9ebd 编写于 作者: fxy060608's avatar fxy060608

fix(mp-alipay): add terserOptions only for production

上级 14f96500
'use strict';
var initMiniProgramPlugin = require('@dcloudio/uni-mp-vite');
var shared = require('@vue/shared');
var path = require('path');
var uniCliShared = require('@dcloudio/uni-cli-shared');
var compilerCore = require('@vue/compiler-core');
var shared = require('@vue/shared');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
......@@ -249,17 +249,20 @@ const options = {
const uniMiniProgramAlipayPlugin = {
name: 'uni:mp-alipay',
config() {
const buildOptions = {};
if (process.env.NODE_ENV === 'production') {
buildOptions.terserOptions = {
compress: false,
mangle: false,
};
}
return {
define: {
__VUE_CREATED_DEFERRED__: false,
},
build: {
build: shared.extend({
assetsInlineLimit: 0,
terserOptions: {
compress: false,
mangle: false,
},
},
}, buildOptions),
};
},
};
......
import type { Plugin } from 'vite'
import type { Plugin, UserConfig } from 'vite'
import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
import { extend } from '@vue/shared'
import { options } from './options'
const uniMiniProgramAlipayPlugin: Plugin = {
name: 'uni:mp-alipay',
config() {
const buildOptions: UserConfig['build'] = {}
if (process.env.NODE_ENV === 'production') {
buildOptions.terserOptions = {
compress: false,
mangle: false,
}
}
return {
define: {
__VUE_CREATED_DEFERRED__: false,
},
build: {
assetsInlineLimit: 0,
terserOptions: {
compress: false,
mangle: false,
build: extend(
{
assetsInlineLimit: 0,
},
},
buildOptions
),
}
},
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册