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

refactor(cli): revert uni_modules

上级 3321698b
...@@ -9,13 +9,10 @@ const { ...@@ -9,13 +9,10 @@ const {
} = require('./util') } = require('./util')
const { const {
getJson,
parseJson parseJson
} = require('./json') } = require('./json')
const {
getPagesJson
} = require('./uni_modules')
let mainEntry = '' let mainEntry = ''
let nvueMainEntry = '' let nvueMainEntry = ''
...@@ -36,6 +33,10 @@ function getNVueMainEntry () { ...@@ -36,6 +33,10 @@ function getNVueMainEntry () {
return nvueMainEntry return nvueMainEntry
} }
function getPagesJson () {
return processPagesJson(getJson('pages.json', true))
}
function parsePagesJson (content, loader) { function parsePagesJson (content, loader) {
return processPagesJson(parseJson(content, true), loader) return processPagesJson(parseJson(content, true), loader)
} }
......
...@@ -30,7 +30,7 @@ function checkEmitFile (filePath, jsonObj, changedEmitFiles) { ...@@ -30,7 +30,7 @@ function checkEmitFile (filePath, jsonObj, changedEmitFiles) {
} }
module.exports = function (content, map) { module.exports = function (content, map) {
content = JSON.stringify(require('@dcloudio/uni-cli-shared/lib/uni_modules').getPagesJson(content)) // content = JSON.stringify(require('@dcloudio/uni-cli-shared/lib/uni_modules').getPagesJson(content))
if (this.resourceQuery) { if (this.resourceQuery) {
const params = loaderUtils.parseQuery(this.resourceQuery) const params = loaderUtils.parseQuery(this.resourceQuery)
if (params) { if (params) {
...@@ -42,12 +42,12 @@ module.exports = function (content, map) { ...@@ -42,12 +42,12 @@ module.exports = function (content, map) {
} }
} }
// add deps // add deps
global.uniModules.forEach(module => { // global.uniModules.forEach(module => {
const uniModulePagesJsonPath = path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules', module, 'pages.json') // const uniModulePagesJsonPath = path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules', module, 'pages.json')
if (fs.existsSync(uniModulePagesJsonPath)) { // if (fs.existsSync(uniModulePagesJsonPath)) {
this.addDependency(uniModulePagesJsonPath) // this.addDependency(uniModulePagesJsonPath)
} // }
}) // })
if ( if (
process.env.UNI_USING_COMPONENTS || process.env.UNI_USING_COMPONENTS ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册