Skip to content

Commit

Permalink
fix: 使用 stats 代替statsFile,避免运行时 require 不到文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongzhi107 committed Jun 17, 2019
1 parent 8097e61 commit bd07e8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ server
) : null;

// This is the stats file generated by webpack loadable plugin
const statsFile = path.resolve(process.env.DACE_PATH_LOADABLE_STATS_JSON);
const stats = require(process.env.DACE_PATH_LOADABLE_STATS_JSON);
// We create an extractor from the statsFile
const extractor = new ChunkExtractor({ statsFile });
const extractor = new ChunkExtractor({ stats });
// Wrap your application using "collectChunks"
const jsx = extractor.collectChunks(Markup);

Expand Down

0 comments on commit bd07e8c

Please sign in to comment.