Open LingYanSi opened 1 year ago
总的来讲,很顺利。遇到唯一的问题是问题是complier.apply is not a function,解决方案是变更一下plugin的使用姿势
complier.apply is not a function
before
compiler.apply(new SingleEntryPlugin(process.cwd(), hmr, pathToEntryName(absolutePath)));
after
new SingleEntryPlugin(process.cwd(), hmr, pathToEntryName(absolutePath)).apply(compiler);
1、生产环境:使用SWC进行minify 2、开发环境:使用swc-loader替换babel-loader
遇到唯一的问题是之前的[...document.body.children]写法需要替换为Array.from(document.body.children)
[...document.body.children]
Array.from(document.body.children)
参考
总的来讲,很顺利。遇到唯一的问题是问题是
complier.apply is not a function
,解决方案是变更一下plugin的使用姿势before
after