Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch02 .1 webpack.config.js不全,npm run dev跑不起来 #108

Open
chengqigang opened this issue Aug 28, 2019 · 1 comment
Open

Ch02 .1 webpack.config.js不全,npm run dev跑不起来 #108

chengqigang opened this issue Aug 28, 2019 · 1 comment

Comments

@chengqigang
Copy link

如题

@ShepherdNg
Copy link

The following extra steps & amendments work for me:
Screenshot from 2019-12-01 17-58-00
npm install webpack-cli

Refer to this issue #101 (comment)
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: [ 

Screenshot from 2019-12-01 17-44-32
Also need to use newer version of babel-loader
npm install babel-loader@7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants