提交 663199d6 编写于 作者: fxy060608's avatar fxy060608

feat(v3): disable cache

上级 4b86f148
...@@ -11,6 +11,10 @@ const { ...@@ -11,6 +11,10 @@ const {
getPartialIdentifier getPartialIdentifier
} = require('../util') } = require('../util')
// const {
// createTemplateCacheLoader
// } = require('../cache-loader')
function getProvides () { function getProvides () {
return { return {
'__f__': [path.resolve(__dirname, '../format-log.js'), 'default'], '__f__': [path.resolve(__dirname, '../format-log.js'), 'default'],
...@@ -23,7 +27,7 @@ const v3 = { ...@@ -23,7 +27,7 @@ const v3 = {
vueConfig: { vueConfig: {
parallel: false parallel: false
}, },
webpackConfig (webpackConfig, vueOptions) { webpackConfig (webpackConfig, vueOptions, api) {
const isAppService = !!vueOptions.pluginOptions['uni-app-plus']['service'] const isAppService = !!vueOptions.pluginOptions['uni-app-plus']['service']
const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view'] const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view']
...@@ -121,6 +125,12 @@ const v3 = { ...@@ -121,6 +125,12 @@ const v3 = {
}] }]
}, },
...rules ...rules
// v3 暂不支持 cache
// createTemplateCacheLoader(api,
// isAppService
// ? 'uni-template-compiler-service'
// : 'uni-template-compiler-view'
// )
] ]
}, },
plugins: [ plugins: [
...@@ -146,12 +156,12 @@ const v3 = { ...@@ -146,12 +156,12 @@ const v3 = {
)) ))
} }
const compilerOptions = Object.assign({ const compilerOptions = {
isUnaryTag, isUnaryTag,
preserveWhitespace: false, preserveWhitespace: false,
service: isAppService, service: isAppService,
view: isAppView view: isAppView
}, cacheConfig) }
// disable vue cache-loader // disable vue cache-loader
webpackConfig.module webpackConfig.module
...@@ -164,7 +174,7 @@ const v3 = { ...@@ -164,7 +174,7 @@ const v3 = {
isAppView, isAppView,
compiler: getPlatformCompiler(), compiler: getPlatformCompiler(),
compilerOptions compilerOptions
})) }, cacheConfig))
.end() .end()
.use('uniapp-custom-block-loader') .use('uniapp-custom-block-loader')
.loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader')) .loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
......
...@@ -125,7 +125,8 @@ if (process.env.UNI_PLATFORM === 'app-plus') { ...@@ -125,7 +125,8 @@ if (process.env.UNI_PLATFORM === 'app-plus') {
platformOptions.compilerVersion === '3' || platformOptions.compilerVersion === '3' ||
platformOptions.compilerVersion === 3 platformOptions.compilerVersion === 3
) )
) { ) {
delete process.env.UNI_USING_CACHE
process.env.UNI_USING_V3 = true process.env.UNI_USING_V3 = true
platformOptions.usingComponents = true platformOptions.usingComponents = true
process.env.UNI_OUTPUT_TMP_DIR = '' process.env.UNI_OUTPUT_TMP_DIR = ''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册