简体   繁体   English

Webpack2:jsx加载器

[英]Webpack2: jsx loader

I'm trying to migrate webpack 1 to 2, but have trouble with jsx: 我正在尝试将Webpack 1迁移到2,但是在jsx上遇到了麻烦:

ERROR in ./src/routes/index.js
Module not found: Error: Can't resolve 'SettingsPage' in '/Users/pavel/rails/spa_frontend/src/routes'
 @ ./src/routes/index.js 37:20-43
 @ ./src/index.jsx
 @ multi webpack-hot-middleware/client ./src/index.jsx

My config for webpack2: 我的webpack2配置:

https://gist.github.com/pustovalov/0292a6094bea6cdec6f84c9fab5e4d2e https://gist.github.com/pustovalov/0292a6094bea6cdec6f84c9fab5e4d2e

This helped me: 这对我有帮助:

  resolve: {
    extensions: ['.js', '.jsx', '.css', '.scss']
  },

Working webpack2 config: 工作webpack2配置:

https://gist.github.com/pustovalov/d82c2421acbb35fb4bf46a61c519ffe0 https://gist.github.com/pustovalov/d82c2421acbb35fb4bf46a61c519ffe0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM