提交 2d3847d4 编写于 作者: Q qiang

Merge branch 'v3' of github.com:dcloudio/uni-app into v3

......@@ -12,5 +12,5 @@
"message": "chore(release): publish %s"
}
},
"version": "3.0.0-alpha-24020191018029"
"version": "3.0.0-alpha-24020191018043"
}
{
"name": "@dcloudio/uni-app-plus-nvue",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app app-plus-nvue",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-app-plus",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app app-plus",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-cli-shared",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-cli-shared",
"main": "lib/index.js",
"repository": {
......@@ -21,5 +21,5 @@
"hash-sum": "^1.0.2",
"strip-json-comments": "^2.0.1"
},
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-h5-ui",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app h5 ui",
"main": "dist/index.umd.min.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-h5",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app h5",
"main": "dist/index.umd.min.js",
"repository": {
......@@ -18,5 +18,5 @@
"intersection-observer": "^0.7.0",
"safe-area-insets": "^1.4.1"
},
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-migration",
"version": "3.0.0-alpha-24020191018027",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app migration",
"main": "lib/index.js",
"repository": {
......@@ -16,7 +16,7 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2",
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00",
"dependencies": {
"mustache": "^3.1.0",
"stricter-htmlparser2": "^3.9.6"
......
{
"name": "@dcloudio/uni-mp-alipay",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app mp-alipay",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-mp-baidu",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app mp-baidu",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-mp-qq",
"version": "3.0.0-alpha-24020191018038",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app mp-qq",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-mp-toutiao",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app mp-toutiao",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-mp-weixin",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app mp-weixin",
"main": "dist/index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-stat",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "",
"main": "dist/index.js",
"repository": {
......@@ -34,5 +34,5 @@
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-uglify": "^6.0.2"
},
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/uni-template-compiler",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-template-compiler",
"main": "lib/index.js",
"repository": {
......@@ -22,5 +22,5 @@
"@babel/types": "^7.3.3",
"vue-template-compiler": "^2.6.10"
},
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
......@@ -37,13 +37,15 @@ const uniPath = process.env.UNI_USING_V8
: '../packages/uni-app-plus-nvue/dist/index.js'
const provide = {}
if (!process.env.UNI_USING_NATIVE) {
provide['uni'] = [path.resolve(__dirname, uniPath), 'default']
}
if (process.env.UNI_USING_V8) {
provide['plus'] = [path.resolve(__dirname, uniPath), 'weexPlus']
if (!process.env.UNI_USING_V3) {
if (!process.env.UNI_USING_NATIVE) {
provide['uni'] = [path.resolve(__dirname, uniPath), 'default']
}
if (process.env.UNI_USING_V8) {
provide['plus'] = [path.resolve(__dirname, uniPath), 'weexPlus']
}
}
if (
......
......@@ -19,19 +19,6 @@ moduleAlias.addAlias('./templateLoader', (fromPath, request, alias) => {
}
return request
})
// vue cache
if ( // 非 h5 ,非 v3,非 native
process.env.UNI_PLATFORM !== 'h5' &&
!process.env.UNI_USING_V3 &&
!process.env.UNI_USING_NATIVE
) {
moduleAlias.addAlias('./loaders/pitcher', (fromPath, request, alias) => {
if (fromPath.indexOf('vue-loader') !== -1) {
return path.resolve(__dirname, 'packages/vue-loader/lib/loaders/pitcher')
}
return request
})
}
if (isInHBuilderX) {
moduleAlias.addAlias('typescript', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
......
{
"name": "@dcloudio/vue-cli-plugin-hbuilderx",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "HBuilderX plugin for vue-cli 3",
"main": "index.js",
"repository": {
......@@ -18,5 +18,5 @@
"css": "~2.2.1",
"escodegen": "^1.8.1"
},
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/vue-cli-plugin-uni-optimize",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app optimize plugin for vue-cli 3",
"main": "index.js",
"repository": {
......@@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
......@@ -26,7 +26,7 @@ module.exports = (api, options) => {
require('./lib/options')(options)
api.configureWebpack(require('./lib/configure-webpack')(platformOptions, manifestPlatformOptions, options, api))
api.chainWebpack(require('./lib/chain-webpack')(platformOptions, api))
api.chainWebpack(require('./lib/chain-webpack')(platformOptions, options, api))
}
module.exports.defaultModes = {
......
......@@ -7,9 +7,14 @@ const {
} = require('@dcloudio/uni-cli-shared')
const {
isUnaryTag
isUnaryTag,
getPartialIdentifier
} = require('../util')
// const {
// createTemplateCacheLoader
// } = require('../cache-loader')
function getProvides () {
return {
'__f__': [path.resolve(__dirname, '../format-log.js'), 'default'],
......@@ -22,7 +27,7 @@ const v3 = {
vueConfig: {
parallel: false
},
webpackConfig (webpackConfig, vueOptions) {
webpackConfig (webpackConfig, vueOptions, api) {
const isAppService = !!vueOptions.pluginOptions['uni-app-plus']['service']
const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view']
......@@ -79,8 +84,8 @@ const v3 = {
externals: {
vue: 'Vue'
},
entry () {
return entry
entry () {
return entry
},
output: {
filename: '[name].js',
......@@ -120,6 +125,12 @@ const v3 = {
}]
},
...rules
// v3 暂不支持 cache
// createTemplateCacheLoader(api,
// isAppService
// ? 'uni-template-compiler-service'
// : 'uni-template-compiler-view'
// )
]
},
plugins: [
......@@ -127,12 +138,24 @@ const v3 = {
]
}
},
chainWebpack (webpackConfig, vueOptions) {
chainWebpack (webpackConfig, vueOptions, api) {
webpackConfig.entryPoints.delete('app')
const isAppService = !!vueOptions.pluginOptions['uni-app-plus']['service']
const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view']
const cacheConfig = {
cacheDirectory: false,
cacheIdentifier: false
}
if (process.env.UNI_USING_CACHE) {
Object.assign(cacheConfig, api.genCacheConfig(
'vue-template-compiler/' + process.env.UNI_PLATFORM,
getPartialIdentifier()
))
}
const compilerOptions = {
isUnaryTag,
preserveWhitespace: false,
......@@ -150,20 +173,30 @@ const v3 = {
isAppService,
isAppView,
compiler: getPlatformCompiler(),
compilerOptions,
cacheDirectory: false,
cacheIdentifier: false
}))
.end()
.use('uniapp-custom-block-loader')
.loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
.options({
compiler: getPlatformCompiler()
})
.end()
.uses
.delete('cache-loader')
compilerOptions
}, cacheConfig))
.end()
.use('uniapp-custom-block-loader')
.loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
.options({
compiler: getPlatformCompiler()
})
// 是否启用 cache
if (process.env.UNI_USING_CACHE) {
webpackConfig.module
.rule('vue')
.use('cache-loader')
.tap(options => Object.assign(options, api.genCacheConfig(
'vue-loader/' + process.env.UNI_PLATFORM,
getPartialIdentifier()
)))
} else {
webpackConfig.module
.rule('vue')
.uses
.delete('cache-loader')
}
if (isAppView) {
if (process.env.NODE_ENV === 'production') {
......
......@@ -62,14 +62,14 @@ function read (key, callback) {
}
module.exports = {
createTemplateCacheLoader: function (api) {
createTemplateCacheLoader: function (api, id = 'uni-template-compiler') {
return {
resourceQuery: /type=uni-cache-loader-template/,
use: [{
loader: 'cache-loader',
ident: 'uni-cache-loader-template-options',
options: Object.assign(api.genCacheConfig(
'uni-template-compiler/' + process.env.UNI_PLATFORM,
id + '/' + process.env.UNI_PLATFORM,
getPartialIdentifier()
), {
read,
......
......@@ -12,7 +12,7 @@ function resolve (dir) {
return path.resolve(__dirname, '..', dir)
}
module.exports = function chainWebpack (platformOptions, api) {
module.exports = function chainWebpack (platformOptions, vueOptions, api) {
const {
runByHBuilderX, // 使用 HBuilderX 运行
cssPreprocessOptions
......@@ -94,7 +94,7 @@ module.exports = function chainWebpack (platformOptions, api) {
})
}
platformOptions.chainWebpack(webpackConfig, api)
platformOptions.chainWebpack(webpackConfig, vueOptions, api)
// define
webpackConfig
.plugin('uni-define')
......
......@@ -23,7 +23,6 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
runByHBuilderX, // 使用 HBuilderX 运行
isInHBuilderX, // 在 HBuilderX 的插件中
hasModule,
getMainEntry,
getPlatformVue,
jsPreprocessOptions,
htmlPreprocessOptions
......@@ -178,7 +177,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
let platformWebpackConfig = platformOptions.webpackConfig
if (typeof platformWebpackConfig === 'function') {
platformWebpackConfig = platformWebpackConfig(webpackConfig, api)
platformWebpackConfig = platformWebpackConfig(webpackConfig, vueOptions, api)
}
// 移除 node_modules 目录,避免受路径上的 node_modules 影响
webpackConfig.resolve.modules = webpackConfig.resolve.modules.filter(module => module !==
......@@ -207,26 +206,6 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
}))
}
let useBuiltIns = 'entry'
if (process.env.UNI_PLATFORM === 'h5') { // 兼容旧版本 h5
useBuiltIns = 'usage'
try {
const babelConfig = require(path.resolve(process.env.UNI_CLI_CONTEXT, 'babel.config.js'))
useBuiltIns = babelConfig.presets[0][1].useBuiltIns
} catch (e) {}
}
const statCode = process.env.UNI_USING_STAT ? `import '@dcloudio/uni-stat';` : ''
let beforeCode = ''
if (process.env.UNI_PLATFORM === 'h5') {
beforeCode = (useBuiltIns === 'entry' ? `import '@babel/polyfill';` : '') +
`import 'uni-pages';import 'uni-${process.env.UNI_PLATFORM}';`
} else {
beforeCode = `import 'uni-pages';`
}
const rules = [{
test: path.resolve(process.env.UNI_INPUT_DIR, 'pages.json'),
use: [{
......@@ -236,18 +215,6 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
}],
type: 'javascript/auto'
},
{
test: path.resolve(process.env.UNI_INPUT_DIR, getMainEntry()),
// resourceQuery: /type=wrapper/,
use: [{
loader: 'wrap-loader',
options: {
before: [
beforeCode + statCode
]
}
}]
},
{
resourceQuery: /vue&type=template/,
use: [{
......
......@@ -125,7 +125,8 @@ if (process.env.UNI_PLATFORM === 'app-plus') {
platformOptions.compilerVersion === '3' ||
platformOptions.compilerVersion === 3
)
) {
) {
delete process.env.UNI_USING_CACHE
process.env.UNI_USING_V3 = true
platformOptions.usingComponents = true
process.env.UNI_OUTPUT_TMP_DIR = ''
......@@ -256,6 +257,20 @@ const moduleAlias = require('module-alias')
moduleAlias.addAlias('vue-template-compiler', '@dcloudio/vue-cli-plugin-uni/packages/vue-template-compiler')
moduleAlias.addAlias('@megalo/template-compiler', '@dcloudio/vue-cli-plugin-uni/packages/@megalo/template-compiler')
moduleAlias.addAlias('mpvue-template-compiler', '@dcloudio/vue-cli-plugin-uni/packages/mpvue-template-compiler')
// vue cache
if ( // 非 h5 ,非 v3,非 native
process.env.UNI_PLATFORM !== 'h5' &&
!process.env.UNI_USING_V3 &&
!process.env.UNI_USING_NATIVE
) {
moduleAlias.addAlias('./loaders/pitcher', (fromPath, request, alias) => {
if (fromPath.indexOf('vue-loader') !== -1) {
return require.resolve('@dcloudio/vue-cli-plugin-hbuilderx/packages/vue-loader/lib/loaders/pitcher')
}
return request
})
}
if (process.env.UNI_PLATFORM === 'mp-toutiao') {
// !important 始终带有一个空格
......@@ -283,7 +298,7 @@ if (runByHBuilderX) {
if (
process.env.UNI_USING_CACHE &&
process.env.UNI_PLATFORM !== 'h5' &&
process.env.UNI_PLATFORM !== 'h5' &&
!process.env.UNI_USING_V3 &&
!process.env.UNI_USING_NATIVE
) { // 使用 cache, 拷贝 cache 的 json
......
......@@ -3,8 +3,7 @@ const path = require('path')
const {
getMainEntry,
getH5Options,
getPlatformCssnano
getH5Options
} = require('@dcloudio/uni-cli-shared')
const modifyVueLoader = require('../vue-loader')
......@@ -63,6 +62,18 @@ if (devServer && Object.keys(devServer).length) {
module.exports = {
vueConfig,
webpackConfig (webpackConfig) {
let useBuiltIns = 'usage'
const statCode = process.env.UNI_USING_STAT ? `import '@dcloudio/uni-stat';` : ''
try {
const babelConfig = require(path.resolve(process.env.UNI_CLI_CONTEXT, 'babel.config.js'))
useBuiltIns = babelConfig.presets[0][1].useBuiltIns
} catch (e) {}
const beforeCode = (useBuiltIns === 'entry' ? `import '@babel/polyfill';` : '') +
`import 'uni-pages';import 'uni-${process.env.UNI_PLATFORM}';`
return {
devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
resolve: {
......@@ -74,6 +85,16 @@ module.exports = {
},
module: {
rules: [{
test: path.resolve(process.env.UNI_INPUT_DIR, getMainEntry()),
use: [{
loader: 'wrap-loader',
options: {
before: [
beforeCode + statCode
]
}
}]
}, {
test: /App\.vue$/,
use: {
loader: 'wrap-loader',
......@@ -84,7 +105,7 @@ module.exports = {
}, {
resourceQuery: /vue&type=template/,
use: [{
loader: resolve('packages/h5-vue-template-loader')
loader: resolve('packages/webpack-uni-app-loader/filter-modules-template.js')
}]
}, {
resourceQuery: [/lang=wxs/, /blockType=wxs/],
......@@ -101,7 +122,7 @@ module.exports = {
plugins
}
},
chainWebpack (webpackConfig, api) {
chainWebpack (webpackConfig, vueOptions, api) {
webpackConfig.plugins.delete('copy')
if (!process.env.UNI_OPT_PREFETCH) {
......@@ -114,52 +135,7 @@ module.exports = {
modifyVueLoader(webpackConfig, require('./compiler-options'), api)
if (process.env.NODE_ENV === 'production') {
const module = webpackConfig.module
// TODO 临时 hack calc:false 看看 vue cli 后续是否开放 cssnano 的配置
const cssnanoOptions = {
sourceMap: false,
plugins: [require('cssnano')({
preset: ['default', getPlatformCssnano()]
})]
}
module.rule('css').oneOf('vue-modules').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('css').oneOf('vue').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('css').oneOf('normal-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('css').oneOf('normal').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('postcss').oneOf('vue-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('postcss').oneOf('vue').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('postcss').oneOf('normal-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('postcss').oneOf('normal').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('scss').oneOf('vue-modules').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('scss').oneOf('vue').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('scss').oneOf('normal-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('scss').oneOf('normal').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('sass').oneOf('vue-modules').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('sass').oneOf('vue').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('sass').oneOf('normal-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('sass').oneOf('normal').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('less').oneOf('vue-modules').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('less').oneOf('vue').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('less').oneOf('normal-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('less').oneOf('normal').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('stylus').oneOf('vue-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('stylus').oneOf('vue').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
module.rule('stylus').oneOf('normal-modules').use('cssnano').loader('postcss-loader').options(
cssnanoOptions)
module.rule('stylus').oneOf('normal').use('cssnano').loader('postcss-loader').options(cssnanoOptions)
require('./cssnano-options')(webpackConfig)
}
}
}
......@@ -62,7 +62,7 @@ module.exports = {
vueConfig: {
parallel: false
},
webpackConfig (webpackConfig, api) {
webpackConfig (webpackConfig, vueOptions, api) {
if (!webpackConfig.optimization) {
webpackConfig.optimization = {}
}
......@@ -94,6 +94,9 @@ module.exports = {
devtool = 'sourcemap'
}
}
const statCode = process.env.UNI_USING_STAT ? `import '@dcloudio/uni-stat';` : ''
const beforeCode = `import 'uni-pages';`
return {
devtool,
......@@ -121,6 +124,13 @@ module.exports = {
rules: [{
test: path.resolve(process.env.UNI_INPUT_DIR, getMainEntry()),
use: [{
loader: 'wrap-loader',
options: {
before: [
beforeCode + statCode
]
}
}, {
loader: '@dcloudio/webpack-uni-mp-loader/lib/main'
}]
}, {
......@@ -154,7 +164,7 @@ module.exports = {
]
}
},
chainWebpack (webpackConfig, api) {
chainWebpack (webpackConfig, vueOptions, api) {
if (process.env.UNI_PLATFORM === 'mp-baidu') {
webpackConfig.module
.rule('js')
......
......@@ -16,17 +16,16 @@ module.exports = {
'link,meta,param,source,track,wbr'
),
getPartialIdentifier () {
if (partialIdentifier) {
return partialIdentifier
}
partialIdentifier = {
'UNI_COMPILER_VERSION': require('../package.json').version
}
Object.keys(process.env).forEach(name => {
if (name.indexOf('UNI_') === 0) {
partialIdentifier[name] = process.env[name]
if (!partialIdentifier) {
partialIdentifier = {
'UNI_COMPILER_VERSION': require('../package.json').version
}
})
Object.keys(process.env).forEach(name => {
if (name.indexOf('UNI_') === 0) {
partialIdentifier[name] = process.env[name]
}
})
}
return partialIdentifier
}
}
......@@ -14,7 +14,6 @@ module.exports = function modifyVueLoader (webpackConfig, compilerOptions, api)
cacheDirectory: false,
cacheIdentifier: false
}
const partialIdentifier = {}
if (process.env.UNI_USING_CACHE) {
Object.assign(cacheConfig, api.genCacheConfig(
......@@ -60,7 +59,7 @@ module.exports = function modifyVueLoader (webpackConfig, compilerOptions, api)
.use('cache-loader')
.tap(options => Object.assign(options, api.genCacheConfig(
'vue-loader/' + process.env.UNI_PLATFORM,
partialIdentifier
getPartialIdentifier()
)))
} else {
webpackConfig.module
......
{
"name": "@dcloudio/vue-cli-plugin-uni",
"version": "2.0.0-23320190923002",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app plugin for vue-cli 3",
"main": "index.js",
"repository": {
......@@ -36,5 +36,5 @@
"wrap-loader": "^0.2.0",
"xregexp": "4.0.0"
},
"gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/webpack-uni-mp-loader",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "webpack-uni-mp-loader",
"main": "index.js",
"repository": {
......@@ -16,5 +16,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
{
"name": "@dcloudio/webpack-uni-pages-loader",
"version": "3.0.0-alpha-24020191018029",
"version": "3.0.0-alpha-24020191018043",
"description": "uni-app pages.json loader",
"main": "lib/index.js",
"repository": {
......@@ -21,7 +21,7 @@
"strip-json-comments": "^2.0.1"
},
"uni-app": {
"compilerVersion": "2.3.4"
"compilerVersion": "2.4.3"
},
"gitHead": "6b0d55e296028761e3de4b561c1ad7c5fb7a23e2"
"gitHead": "110501ffb0313e417858dec92acf07522d4ded00"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册