Comments (1)
遇到同樣的問題 註記
module: {
// loaders 則是放欲使用的 loaders,在這邊是使用 babel-loader 將所有 .js(這邊用到正則式)相關檔案(排除了 npm 安裝的套件位置 node_modules)轉譯成瀏覽器可以閱讀的 JavaScript。preset 則是使用的 babel 轉譯規則,這邊使用 react、es2015。若是已經單獨使用 .babelrc 作為 presets 設定的話,則可以省略 query
loaders: [ // <<<<<<<<<<<<<<<< loaders需要改為 rules
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react'], // <<<<<<<<<<<<<<<<此處需要安裝babel-present-env後改為 ["env", "react"],
},
},
],
},
from reactjs101.
Related Issues (20)
- npm run dev 失敗 HOT 2
- Ch02 .1 webpack.config.js不全,npm run dev跑不起来 HOT 1
- CH10. 食譜網站實作疑問
- 模板template和组件component具体有什么差别呢?
- it takes me to https://legacy.gitbook.com/book/kdchang/react101/details
- Ch4 Ch5 關於stateless component的小疑問
- 【React源码专题文章推荐】专注于React源码解析的文章
- travis CI build failed HOT 1
- 希望能补上函数式react的用法讲解,对于每一个实例
- 學習 React HOT 1
- CH09编译出错
- 在Ch04的例子中,新版本的propTypes需要引入新的包prop-types
- ch10 createAction first parameter should apply const not string?
- Ch03 npm start 編譯失敗
- CH02 NPM Install 指令疑問 HOT 3
- ch09:Uncaught TypeError: Cannot read property 'EventPluginHub' of undefined HOT 1
- Ch2 webpack error messenge HOT 2
- English [en-US] translation HOT 1
- The Travis CI build failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactjs101.