asfktz / autodll-webpack-plugin

Webpack's DllPlugin without the boilerplate
MIT License
1.46k stars 80 forks source link

got error when use dynamic import #125

Open deepkolos opened 6 years ago

deepkolos commented 6 years ago

i want to pack a mini router resolver which aim at faster trigger the current route's componet's load, but i got error

const page = view => {
  view instanceof Array && (view = view[0]);

  return () => import(/* webpackChunkName: "page/[request]" */ `../views/pages/${view}`);
};

const cfg = {...};

export default cfg;
Unhandled rejection Error: no such file or directory
    at MemoryFileSystem.writeFileSync (D:\DEV\Github\work\feng-bbs-mobile\node_modules\memory-fs\lib\MemoryFileSystem.js:207:10)
    at D:\DEV\Github\work\feng-bbs-mobile\node_modules\autodll-webpack-plugin\lib\createMemory.js:62:11
    at tryCatcher (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\util.js:16:23)
    at Object.gotValue (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\reduce.js:155:18)
    at Object.gotAccum (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\reduce.js:144:25)
    at Object.tryCatcher (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromiseCtx (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\promise.js:606:10)
    at _drainQueueStep (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\async.js:142:12)
    at _drainQueue (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\async.js:131:9)
    at Async._drainQueues (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\DEV\Github\work\feng-bbs-mobile\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)