提交 95ed3300 编写于 作者: fxy060608's avatar fxy060608

chore(app): minify

上级 d5896d19
......@@ -55,7 +55,7 @@ export default defineConfig({
root: __dirname,
define: {
global: 'window',
__DEV__: true,
__DEV__: false,
__TEST__: false,
__PLATFORM__: JSON.stringify('app'),
__NODE_JS__: false,
......@@ -119,7 +119,7 @@ export default defineConfig({
vueJsx({ optimize: true, isCustomElement }),
],
build: {
minify: false,
minify: true,
lib: {
name: 'uni-app-view',
fileName: 'uni-app-view',
......
......@@ -10,7 +10,7 @@ import { uniTemplatePlugin } from './plugins/template'
import { uniMainJsPlugin } from './plugins/mainJs'
import { uniManifestJsonPlugin } from './plugins/manifestJson'
import { uniPagesJsonPlugin } from './plugins/pagesJson'
import { uniResolveIdPlugin } from './plugins/resolveId'
// import { uniResolveIdPlugin } from './plugins/resolveId'
import { uniRenderjsPlugin } from './plugins/renderjs'
function initUniCssScopedPluginOptions() {
......@@ -29,7 +29,7 @@ function initUniCssScopedPluginOptions() {
}
const plugins = [
uniResolveIdPlugin(),
// uniResolveIdPlugin(),
uniMainJsPlugin(),
uniManifestJsonPlugin(),
uniPagesJsonPlugin(),
......
......@@ -20,9 +20,9 @@ export const UniAppPlugin: UniVitePlugin = {
}
},
configResolved,
resolveId(id) {
if (id === 'vue') {
return resolveBuiltIn('@dcloudio/uni-app-vue')
}
},
// resolveId(id) {
// if (id === 'vue') {
// return resolveBuiltIn('@dcloudio/uni-app-vue')
// }
// },
}
[
{
"input": {
"src/service/index.ts": ["dist/service.runtime.esm.js"]
"src/service/index.ts": ["dist/service.runtime.esm.dev.js"]
},
"output": {
"banner": "export default function vueFactory (exports) {\n",
......@@ -9,7 +9,24 @@
},
"replacements": {
"__VUE_OPTIONS_API__": "true",
"__VUE_PROD_DEVTOOLS__": "false"
"__VUE_PROD_DEVTOOLS__": "false",
"process.env.NODE_ENV": "\"development\""
},
"external": false,
"babel": true
},
{
"input": {
"src/service/index.ts": ["dist/service.runtime.esm.prod.js"]
},
"output": {
"banner": "export default function vueFactory (exports) {\n",
"footer": "}"
},
"replacements": {
"__VUE_OPTIONS_API__": "true",
"__VUE_PROD_DEVTOOLS__": "false",
"process.env.NODE_ENV": "\"production\""
},
"external": false,
"babel": true
......
此差异已折叠。
......@@ -2,8 +2,8 @@
"name": "@dcloudio/uni-app-vue",
"version": "3.0.0-alpha-3000020210813001",
"description": "@dcloudio/uni-app-vue",
"main": "dist/service.runtime.esm.js",
"module": "dist/service.runtime.esm.js",
"main": "dist/service.runtime.esm.dev.js",
"module": "dist/service.runtime.esm.dev.js",
"files": [
"dist"
],
......
......@@ -16,7 +16,9 @@ export default class WatchPlugin {
compiler.hooks.invalid.tap('WatchPlugin', () => {
if (!isCompiling) {
isCompiling = true
console.log(M['dev.watching.start'])
if (!isFirst) {
console.log(M['dev.watching.start'])
}
}
})
compiler.hooks.done.tap('WatchPlugin', (stats) => {
......
......@@ -15,8 +15,12 @@ export async function runDev(options: CliOptions & ServerOptions) {
await (options.ssr ? createSSRServer(options) : createServer(options))
} else {
const watcher = (await build(options)) as RollupWatcher
let isFirst = true
watcher.on('event', (event) => {
if (event.code === 'BUNDLE_START') {
if (isFirst) {
return (isFirst = false)
}
console.log(M['dev.watching.start'])
} else if (event.code === 'BUNDLE_END') {
event.result.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册