Array-Huang / webpack-seed

这是一个基于webpack的多页应用脚手架
https://segmentfault.com/a/1190000006843916
MIT License
1.18k stars 283 forks source link

好像炸了啊。。。 #48

Closed Jemair closed 7 years ago

Jemair commented 7 years ago

编译的时候报了一大堆错 提示找不到es2015这个preset 重新安装一下似乎也没有作用 要不你看看?

    ERROR in ./~/html-webpack-plugin/lib/loader.js!./src/pages/user/modify-info/html.js
    Module build failed: Error: Couldn't find preset "es2015" relative to directory "/Users/lianming.wang"
        at /Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
        at Array.map (native)
        at OptionManager.resolvePresets (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
        at OptionManager.mergePresets (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
        at OptionManager.mergeOptions (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
        at OptionManager.init (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
        at File.initOptions (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/index.js:212:65)
        at new File (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/file/index.js:135:24)
        at Pipeline.transform (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
        at transpile (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-loader/lib/index.js:46:20)
        at /Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-loader/lib/fs-cache.js:79:18
        at ReadFileContext.callback (/Users/lianming.wang/Desktop/webpack-seed/node_modules/babel-loader/lib/fs-cache.js:15:14)
        at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13)
Jemair commented 7 years ago

找到原因了 是因为你的项目里没有.babelrc 导致去了全局的目录下找es2015 麻烦之后的版本加一下 目前这样比较不友好