@mpxjs/webpack-plugin 2.7.0-beta.1 → 2.7.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/lib/dependencies/AppEntryDependency.js +2 -0
  2. package/lib/dependencies/CommonJsVariableDependency.js +9 -5
  3. package/lib/dependencies/DynamicEntryDependency.js +8 -3
  4. package/lib/dependencies/FlagPluginDependency.js +1 -0
  5. package/lib/dependencies/RecordIndependentDependency.js +41 -0
  6. package/lib/dependencies/{RecordStaticResourceDependency.js → RecordResourceMapDependency.js} +12 -7
  7. package/lib/dependencies/RemoveEntryDependency.js +40 -0
  8. package/lib/dependencies/ResolveDependency.js +8 -7
  9. package/lib/extractor.js +7 -4
  10. package/lib/file-loader.js +2 -2
  11. package/lib/helpers.js +1 -0
  12. package/lib/index.js +218 -146
  13. package/lib/json-compiler/helper.js +21 -25
  14. package/lib/json-compiler/index.js +70 -54
  15. package/lib/json-compiler/plugin.js +21 -5
  16. package/lib/loader.js +59 -77
  17. package/lib/native-loader.js +28 -65
  18. package/lib/parser.js +1 -2
  19. package/lib/platform/json/wx/index.js +7 -2
  20. package/lib/platform/template/wx/component-config/button.js +3 -3
  21. package/lib/platform/template/wx/component-config/navigator.js +1 -1
  22. package/lib/record-loader.js +2 -2
  23. package/lib/resolver/AddEnvPlugin.js +3 -2
  24. package/lib/resolver/AddModePlugin.js +3 -2
  25. package/lib/runtime/base.styl +5 -0
  26. package/lib/runtime/components/web/getInnerListeners.js +51 -45
  27. package/lib/runtime/components/web/mpx-keep-alive.vue +4 -1
  28. package/lib/runtime/components/web/mpx-tab-bar-container.vue +2 -2
  29. package/lib/runtime/optionProcessor.js +5 -20
  30. package/lib/runtime/stringify.wxs +3 -3
  31. package/lib/selector.js +23 -5
  32. package/lib/style-compiler/index.js +8 -10
  33. package/lib/template-compiler/bind-this.js +4 -4
  34. package/lib/template-compiler/compiler.js +109 -46
  35. package/lib/template-compiler/index.js +3 -6
  36. package/lib/template-compiler/trans-dynamic-class-expr.js +3 -3
  37. package/lib/utils/const.js +5 -1
  38. package/lib/utils/eval-json-js.js +31 -0
  39. package/lib/utils/get-json-content.js +41 -0
  40. package/lib/utils/resolve.js +13 -0
  41. package/lib/web/processJSON.js +113 -142
  42. package/lib/web/processScript.js +30 -30
  43. package/lib/web/processTemplate.js +56 -40
  44. package/lib/wxs/i18n-loader.js +1 -3
  45. package/lib/wxs/loader.js +24 -27
  46. package/lib/wxs/pre-loader.js +7 -8
  47. package/lib/wxss/processCss.js +44 -44
  48. package/package.json +8 -8
  49. package/lib/built-in-loader.js +0 -49
  50. package/lib/utils/get-main-compilation.js +0 -6
  51. package/lib/utils/read-json-for-src.js +0 -34
@@ -4,30 +4,27 @@ const nativeLoaderPath = normalize.lib('native-loader')
4
4
  const isUrlRequestRaw = require('../utils/is-url-request')
5
5
  const parseRequest = require('../utils/parse-request')
6
6
  const loaderUtils = require('loader-utils')
7
+ const resolve = require('../utils/resolve')
7
8
 
8
- module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
9
+ module.exports = function createJSONHelper ({ loaderContext, emitWarning, customGetDynamicEntry }) {
9
10
  const mpx = loaderContext.getMpx()
10
11
  const resolveMode = mpx.resolveMode
11
12
  const externals = mpx.externals
12
13
  const root = mpx.projectRoot
13
14
  const publicPath = loaderContext._compilation.outputOptions.publicPath || ''
14
15
  const pathHash = mpx.pathHash
16
+ const getOutputPath = mpx.getOutputPath
17
+ const mode = mpx.mode
15
18
 
16
19
  const isUrlRequest = r => isUrlRequestRaw(r, root, externals)
17
20
  const urlToRequest = r => loaderUtils.urlToRequest(r)
18
21
 
19
- // todo 提供不记录dependency的resolve方法,非必要的情况下不记录dependency,提升缓存利用率
20
- const resolve = (context, request, callback) => {
21
- const { queryObj } = parseRequest(request)
22
- context = queryObj.context || context
23
- return loaderContext.resolve(context, request, callback)
24
- }
25
-
26
22
  const dynamicEntryMap = new Map()
27
23
 
28
24
  let dynamicEntryCount = 0
29
25
 
30
26
  const getDynamicEntry = (resource, type, outputPath = '', packageRoot = '', relativePath = '') => {
27
+ if (typeof customGetDynamicEntry === 'function') return customGetDynamicEntry(resource, type, outputPath, packageRoot, relativePath)
31
28
  const key = `mpx_dynamic_entry_${dynamicEntryCount++}`
32
29
  const value = `__mpx_dynamic_entry__( ${JSON.stringify(resource)},${JSON.stringify(type)},${JSON.stringify(outputPath)},${JSON.stringify(packageRoot)},${JSON.stringify(relativePath)})`
33
30
  dynamicEntryMap.set(key, value)
@@ -42,14 +39,16 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
42
39
  }
43
40
 
44
41
  const processComponent = (component, context, { tarRoot = '', outputPath = '', relativePath = '' }, callback) => {
45
- if (!isUrlRequest(component)) return callback()
42
+ if (!isUrlRequest(component)) return callback(null, component)
46
43
  if (resolveMode === 'native') {
47
44
  component = urlToRequest(component)
48
45
  }
49
46
 
50
- resolve(context, component, (err, resource, info) => {
47
+ resolve(context, component, loaderContext, (err, resource, info) => {
51
48
  if (err) return callback(err)
52
- const resourcePath = parseRequest(resource).resourcePath
49
+ const { resourcePath, queryObj } = parseRequest(resource)
50
+ // 目前只有微信支持分包异步化
51
+ if (queryObj.root && mode === 'wx') tarRoot = queryObj.root
53
52
  const parsed = path.parse(resourcePath)
54
53
  const ext = parsed.ext
55
54
  const resourceName = path.join(parsed.dir, parsed.name)
@@ -70,8 +69,7 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
70
69
  let relative = path.relative(root, resourceName)
71
70
  outputPath = path.join('components', name + pathHash(root), relative)
72
71
  } else {
73
- let componentName = parsed.name
74
- outputPath = path.join('components', componentName + pathHash(resourcePath), componentName)
72
+ outputPath = getOutputPath(resourcePath, 'component')
75
73
  }
76
74
  }
77
75
  if (ext === '.js') {
@@ -83,24 +81,19 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
83
81
  })
84
82
  }
85
83
 
86
- const getPageName = (resourcePath, ext) => {
87
- const baseName = path.basename(resourcePath, ext)
88
- return path.join('pages', baseName + pathHash(resourcePath), baseName)
89
- }
90
-
91
84
  const processPage = (page, context, tarRoot = '', callback) => {
92
85
  let aliasPath = ''
93
86
  if (typeof page !== 'string') {
94
87
  aliasPath = page.path
95
88
  page = page.src
96
89
  }
97
- if (!isUrlRequest(page)) return callback()
90
+ if (!isUrlRequest(page)) return callback(null, page)
98
91
  if (resolveMode === 'native') {
99
92
  page = urlToRequest(page)
100
93
  }
101
- resolve(context, page, (err, resource) => {
94
+ resolve(context, page, loaderContext, (err, resource) => {
102
95
  if (err) return callback(err)
103
- const { resourcePath } = parseRequest(resource)
96
+ const { resourcePath, queryObj: { isFirst } } = parseRequest(resource)
104
97
  const ext = path.extname(resourcePath)
105
98
  let outputPath
106
99
  if (aliasPath) {
@@ -109,7 +102,7 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
109
102
  const relative = path.relative(context, resourcePath)
110
103
  if (/^\./.test(relative)) {
111
104
  // 如果当前page不存在于context中,对其进行重命名
112
- outputPath = getPageName(resourcePath, ext)
105
+ outputPath = getOutputPath(resourcePath, 'page')
113
106
  emitWarning(`Current page [${resourcePath}] is not in current pages directory [${context}], the page path will be replaced with [${outputPath}], use ?resolve to get the page path and navigate to it!`)
114
107
  } else {
115
108
  outputPath = /^(.*?)(\.[^.]*)?$/.exec(relative)[1]
@@ -119,7 +112,11 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
119
112
  resource = `!!${nativeLoaderPath}!${resource}`
120
113
  }
121
114
  const entry = getDynamicEntry(resource, 'page', outputPath, tarRoot, publicPath + tarRoot)
122
- callback(null, entry)
115
+ const key = [resourcePath, outputPath, tarRoot].join('|')
116
+ callback(null, entry, {
117
+ isFirst,
118
+ key
119
+ })
123
120
  })
124
121
  }
125
122
 
@@ -127,7 +124,7 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
127
124
  if (resolveMode === 'native') {
128
125
  js = urlToRequest(js)
129
126
  }
130
- resolve(context, js, (err, resource) => {
127
+ resolve(context, js, loaderContext, (err, resource) => {
131
128
  if (err) return callback(err)
132
129
  const { resourcePath } = parseRequest(resource)
133
130
  const relative = path.relative(context, resourcePath)
@@ -145,7 +142,6 @@ module.exports = function createJSONHelper ({ loaderContext, emitWarning }) {
145
142
  processDynamicEntry,
146
143
  processPage,
147
144
  processJsExport,
148
- resolve,
149
145
  isUrlRequest,
150
146
  urlToRequest
151
147
  }
@@ -4,15 +4,17 @@ const path = require('path')
4
4
  const parseComponent = require('../parser')
5
5
  const config = require('../config')
6
6
  const parseRequest = require('../utils/parse-request')
7
- const mpxJSON = require('../utils/mpx-json')
7
+ const evalJSONJS = require('../utils/eval-json-js')
8
8
  const fixUsingComponent = require('../utils/fix-using-component')
9
9
  const getRulesRunner = require('../platform/index')
10
10
  const addQuery = require('../utils/add-query')
11
- const readJsonForSrc = require('../utils/read-json-for-src')
11
+ const getJSONContent = require('../utils/get-json-content')
12
12
  const createHelpers = require('../helpers')
13
13
  const createJSONHelper = require('./helper')
14
14
  const RecordGlobalComponentsDependency = require('../dependencies/RecordGlobalComponentsDependency')
15
- const { MPX_DISABLE_EXTRACTOR_CACHE } = require('../utils/const')
15
+ const RecordIndependentDependency = require('../dependencies/RecordIndependentDependency')
16
+ const { MPX_DISABLE_EXTRACTOR_CACHE, RESOLVE_IGNORED_ERR, JSON_JS_EXT } = require('../utils/const')
17
+ const resolve = require('../utils/resolve')
16
18
 
17
19
  module.exports = function (content) {
18
20
  const nativeCallback = this.async()
@@ -27,13 +29,13 @@ module.exports = function (content) {
27
29
  // 微信插件下要求组件使用相对路径
28
30
  const useRelativePath = mpx.isPluginMode || mpx.useRelativePath
29
31
  const { resourcePath, queryObj } = parseRequest(this.resource)
32
+ const useJSONJS = queryObj.useJSONJS || this.resourcePath.endsWith(JSON_JS_EXT)
30
33
  const packageName = queryObj.packageRoot || mpx.currentPackageRoot || 'main'
31
34
  const pagesMap = mpx.pagesMap
32
35
  const componentsMap = mpx.componentsMap[packageName]
33
36
  const appInfo = mpx.appInfo
34
37
  const mode = mpx.mode
35
38
  const env = mpx.env
36
- const defs = mpx.defs
37
39
  const globalSrcMode = mpx.srcMode
38
40
  const localSrcMode = queryObj.mode
39
41
  const srcMode = localSrcMode || globalSrcMode
@@ -55,7 +57,6 @@ module.exports = function (content) {
55
57
  }
56
58
 
57
59
  const {
58
- resolve,
59
60
  isUrlRequest,
60
61
  urlToRequest,
61
62
  processPage,
@@ -121,12 +122,10 @@ module.exports = function (content) {
121
122
  nativeCallback(null, output)
122
123
  }
123
124
 
124
- let json = {}
125
+ let json
125
126
  try {
126
- // 使用了MPXJSON的话先编译
127
- // 此处需要使用真实的resourcePath
128
- if (this.resourcePath.endsWith('.json.js')) {
129
- json = JSON.parse(mpxJSON.compileMPXJSONText({ source: content, defs, filePath: this.resourcePath }))
127
+ if (useJSONJS) {
128
+ json = evalJSONJS(content, this.resourcePath, this)
130
129
  } else {
131
130
  json = JSON5.parse(content || '{}')
132
131
  }
@@ -200,6 +199,10 @@ module.exports = function (content) {
200
199
  if (components) {
201
200
  async.eachOf(components, (component, name, callback) => {
202
201
  processComponent(component, context, { relativePath }, (err, entry) => {
202
+ if (err === RESOLVE_IGNORED_ERR) {
203
+ delete components[name]
204
+ return callback()
205
+ }
203
206
  if (err) return callback(err)
204
207
  components[name] = entry
205
208
  callback()
@@ -214,26 +217,20 @@ module.exports = function (content) {
214
217
  // app.json
215
218
  const localPages = []
216
219
  const subPackagesCfg = {}
217
- // 添加首页标识
218
- if (json.pages && json.pages[0]) {
219
- if (typeof json.pages[0] !== 'string') {
220
- json.pages[0].src = addQuery(json.pages[0].src, { isFirst: true })
221
- } else {
222
- json.pages[0] = addQuery(json.pages[0], { isFirst: true })
223
- }
224
- }
220
+ const pageKeySet = new Set()
225
221
 
226
222
  const processPages = (pages, context, tarRoot = '', callback) => {
227
223
  if (pages) {
228
224
  async.each(pages, (page, callback) => {
229
- const { queryObj } = parseRequest(page)
230
- processPage(page, context, tarRoot, (err, entry) => {
231
- if (err) return callback(err)
225
+ processPage(page, context, tarRoot, (err, entry, { isFirst, key } = {}) => {
226
+ if (err) return callback(err === RESOLVE_IGNORED_ERR ? null : err)
227
+ if (pageKeySet.has(key)) return callback()
228
+ pageKeySet.add(key)
232
229
  if (tarRoot && subPackagesCfg) {
233
230
  subPackagesCfg[tarRoot].pages.push(entry)
234
231
  } else {
235
232
  // 确保首页
236
- if (queryObj.isFirst) {
233
+ if (isFirst) {
237
234
  localPages.unshift(entry)
238
235
  } else {
239
236
  localPages.push(entry)
@@ -253,13 +250,13 @@ module.exports = function (content) {
253
250
  const { queryObj } = parseRequest(packagePath)
254
251
  async.waterfall([
255
252
  (callback) => {
256
- resolve(context, packagePath, (err, result) => {
253
+ resolve(context, packagePath, this, (err, result) => {
254
+ if (err) return callback(err)
257
255
  const { rawResourcePath } = parseRequest(result)
258
256
  callback(err, rawResourcePath)
259
257
  })
260
258
  },
261
259
  (result, callback) => {
262
- this.addDependency(result)
263
260
  fs.readFile(result, (err, content) => {
264
261
  if (err) return callback(err)
265
262
  callback(err, result, content.toString('utf-8'))
@@ -272,19 +269,14 @@ module.exports = function (content) {
272
269
  filePath: result,
273
270
  needMap: this.sourceMap,
274
271
  mode,
275
- defs,
276
272
  env
277
273
  })
278
- const json = parts.json || {}
279
- if (json.content) {
280
- content = json.content
281
- } else if (json.src) {
282
- return readJsonForSrc(json.src, this, (content) => {
283
- callback(null, result, content)
284
- })
285
- }
274
+ getJSONContent(parts.json || {}, this, (err, content) => {
275
+ callback(err, result, content)
276
+ })
277
+ } else {
278
+ callback(null, result, content)
286
279
  }
287
- callback(null, result, content)
288
280
  },
289
281
  (result, content, callback) => {
290
282
  try {
@@ -330,7 +322,9 @@ module.exports = function (content) {
330
322
  callback()
331
323
  }
332
324
  }
333
- ], callback)
325
+ ], (err) => {
326
+ callback(err === RESOLVE_IGNORED_ERR ? null : err)
327
+ })
334
328
  }, callback)
335
329
  } else {
336
330
  callback()
@@ -367,7 +361,7 @@ module.exports = function (content) {
367
361
  const otherConfig = getOtherConfig(subPackage)
368
362
  // 支付宝不支持独立分包,无需处理
369
363
  if (otherConfig.independent && mode !== 'ali') {
370
- mpx.independentSubpackagesMap[tarRoot] = true
364
+ this._module.addPresentationalDependency(new RecordIndependentDependency(tarRoot))
371
365
  }
372
366
 
373
367
  subPackagesCfg[tarRoot] = {
@@ -452,17 +446,31 @@ module.exports = function (content) {
452
446
 
453
447
  const processCustomTabBar = (tabBar, context, callback) => {
454
448
  if (tabBar && tabBar.custom) {
455
- processComponent('./custom-tab-bar/index', context, { outputPath: 'custom-tab-bar/index' }, callback)
449
+ processComponent('./custom-tab-bar/index', context, { outputPath: 'custom-tab-bar/index' }, (err) => {
450
+ if (err === RESOLVE_IGNORED_ERR) {
451
+ delete tabBar.custom
452
+ return callback()
453
+ }
454
+ callback(err)
455
+ })
456
456
  } else {
457
457
  callback()
458
458
  }
459
459
  }
460
460
 
461
- const processPluginGenericsImplementation = (genericsImplementation, context, tarRoot, callback) => {
461
+ const processPluginGenericsImplementation = (plugin, context, tarRoot, callback) => {
462
+ if (!plugin.genericsImplementation) return callback()
462
463
  const relativePath = useRelativePath ? publicPath + tarRoot : ''
463
- async.eachOf(genericsImplementation, (genericComponents, name, callback) => {
464
+ async.eachOf(plugin.genericsImplementation, (genericComponents, name, callback) => {
464
465
  async.eachOf(genericComponents, (genericComponentPath, name, callback) => {
465
- processComponent(genericComponentPath, context, { tarRoot, relativePath }, (err, entry) => {
466
+ processComponent(genericComponentPath, context, {
467
+ tarRoot,
468
+ relativePath
469
+ }, (err, entry) => {
470
+ if (err === RESOLVE_IGNORED_ERR) {
471
+ delete genericComponents[name]
472
+ return callback()
473
+ }
466
474
  if (err) return callback(err)
467
475
  genericComponents[name] = entry
468
476
  })
@@ -471,10 +479,12 @@ module.exports = function (content) {
471
479
  }
472
480
 
473
481
  const processPluginExport = (plugin, context, tarRoot, callback) => {
474
- if (!plugin.export) {
475
- return callback()
476
- }
482
+ if (!plugin.export) return callback()
477
483
  processJsExport(plugin.export, context, tarRoot, (err, entry) => {
484
+ if (err === RESOLVE_IGNORED_ERR) {
485
+ delete plugin.export
486
+ return callback()
487
+ }
478
488
  if (err) return callback(err)
479
489
  plugin.export = entry
480
490
  callback()
@@ -486,31 +496,33 @@ module.exports = function (content) {
486
496
  async.eachOf(plugins, (plugin, name, callback) => {
487
497
  async.parallel([
488
498
  (callback) => {
489
- if (plugin.genericsImplementation) {
490
- processPluginGenericsImplementation(plugin.genericsImplementation, context, tarRoot, callback)
491
- } else {
492
- callback()
493
- }
499
+ processPluginGenericsImplementation(plugin, context, tarRoot, callback)
494
500
  },
495
501
  (callback) => {
496
502
  processPluginExport(plugin, context, tarRoot, callback)
497
503
  }
498
- ], (err) => {
499
- callback(err)
500
- })
504
+ ], callback)
501
505
  }, callback)
502
506
  }
503
507
 
504
508
  async.parallel([
505
509
  (callback) => {
506
- processPlugins(json.plugins, this.context, '', callback)
507
- },
508
- (callback) => {
510
+ // 添加首页标识
511
+ if (json.pages && json.pages[0]) {
512
+ if (typeof json.pages[0] !== 'string') {
513
+ json.pages[0].src = addQuery(json.pages[0].src, { isFirst: true })
514
+ } else {
515
+ json.pages[0] = addQuery(json.pages[0], { isFirst: true })
516
+ }
517
+ }
509
518
  processPages(json.pages, this.context, '', callback)
510
519
  },
511
520
  (callback) => {
512
521
  processComponents(json.usingComponents, this.context, callback)
513
522
  },
523
+ (callback) => {
524
+ processPlugins(json.plugins, this.context, '', callback)
525
+ },
514
526
  (callback) => {
515
527
  processWorkers(json.workers, this.context, callback)
516
528
  },
@@ -551,6 +563,10 @@ module.exports = function (content) {
551
563
  async.eachOf(generics, (generic, name, callback) => {
552
564
  if (generic.default) {
553
565
  processComponent(generic.default, context, { relativePath }, (err, entry) => {
566
+ if (err === RESOLVE_IGNORED_ERR) {
567
+ delete generic.default
568
+ return callback()
569
+ }
554
570
  if (err) return callback(err)
555
571
  generic.default = entry
556
572
  callback()
@@ -2,7 +2,9 @@ const async = require('async')
2
2
  const JSON5 = require('json5')
3
3
  const getEntryName = require('../utils/get-entry-name')
4
4
  const FlagPluginDependency = require('../dependencies/FlagPluginDependency')
5
+ const RemoveEntryDependency = require('../dependencies/RemoveEntryDependency')
5
6
  const createJSONHelper = require('./helper')
7
+ const { MPX_DISABLE_EXTRACTOR_CACHE, RESOLVE_IGNORED_ERR } = require('../utils/const')
6
8
 
7
9
  module.exports = function (source) {
8
10
  // 该loader中会在每次编译中动态添加entry,不能缓存,否则watch不好使
@@ -14,6 +16,9 @@ module.exports = function (source) {
14
16
  return nativeCallback(null, source)
15
17
  }
16
18
 
19
+ // json模块必须每次都创建(但并不是每次都需要build),用于动态添加编译入口,传递信息以禁用父级extractor的缓存
20
+ this.emitFile(MPX_DISABLE_EXTRACTOR_CACHE, '', undefined, { skipEmit: true })
21
+
17
22
  this._module.addPresentationalDependency(new FlagPluginDependency())
18
23
 
19
24
  const emitWarning = (msg) => {
@@ -45,7 +50,7 @@ module.exports = function (source) {
45
50
  const srcMode = mpx.srcMode
46
51
  const entryName = getEntryName(this)
47
52
  // 最终输出中不需要为plugin.json产生chunk,而是使用extractor输出,删除plugin.json对应的entrypoint
48
- if (entryName) this._compilation.entries.delete(entryName)
53
+ if (entryName) this._module.addPresentationalDependency(new RemoveEntryDependency(entryName))
49
54
 
50
55
  // 新模式下plugin.json输出依赖于extractor
51
56
  const callback = (err, processOutput) => {
@@ -66,6 +71,10 @@ module.exports = function (source) {
66
71
  const processMain = (main, callback) => {
67
72
  if (!main) return callback()
68
73
  processJsExport(main, context, '', (err, entry) => {
74
+ if (err === RESOLVE_IGNORED_ERR) {
75
+ delete pluginEntry.main
76
+ return callback()
77
+ }
69
78
  if (err) return callback(err)
70
79
  pluginEntry.main = entry
71
80
  callback()
@@ -76,8 +85,12 @@ module.exports = function (source) {
76
85
  if (!components) return callback()
77
86
  async.eachOf(components, (component, name, callback) => {
78
87
  processComponent(component, context, { relativePath }, (err, entry) => {
88
+ if (err === RESOLVE_IGNORED_ERR) {
89
+ delete components[name]
90
+ return callback()
91
+ }
79
92
  if (err) return callback(err)
80
- pluginEntry.publicComponents[name] = entry
93
+ components[name] = entry
81
94
  callback()
82
95
  })
83
96
  }, callback)
@@ -105,15 +118,18 @@ module.exports = function (source) {
105
118
 
106
119
  async.eachOf(pages, (page, key) => {
107
120
  processPage(page, context, '', (err, entry) => {
121
+ if (err === RESOLVE_IGNORED_ERR) {
122
+ delete pages[key]
123
+ return callback()
124
+ }
108
125
  if (err) return callback(err)
109
- pages[key] = entry
110
126
  if (mode === 'ali') {
111
127
  pluginEntry.pages.push(entry)
112
128
  if (!/^__private_page_\d+__$/.test(key)) {
113
129
  pluginEntry.publicPages[key] = entry
114
130
  }
115
131
  } else {
116
- pluginEntry.pages[key] = entry
132
+ pages[key] = entry
117
133
  }
118
134
  callback()
119
135
  })
@@ -126,7 +142,7 @@ module.exports = function (source) {
126
142
  }, (callback) => {
127
143
  return processComponents(pluginEntry.publicComponents, callback)
128
144
  }, (callback) => {
129
- return processPages(pluginEntry.publicPages, callback)
145
+ return processPages(pluginEntry.pages, callback)
130
146
  }
131
147
  ], (err) => {
132
148
  return callback(err, processDynamicEntry)