Open chengqigang opened 5 years ago
The following extra steps & amendments work for me:
npm install webpack-cli
Refer to this issue https://github.com/kdchang/reactjs101/issues/101#issue-338796831 In module of webpack.config.js , change loaders as rules:
module: {
// loaders 則是放欲使用的 loaders,在這邊是使用 babel-loader 將所有 .js(這邊用到正則式)相關檔案(排除了 npm 安裝的套件位置 node_modules)轉譯成瀏覽器可以閱讀的 JavaScript。preset 則是使用的 babel 轉譯規則,這邊使用 react、es2015。若是已經單獨使用 .babelrc 作為 presets 設定的話,則可以省略 query
rules: [
Also need to use newer version of babel-loader
npm install babel-loader@7
如题