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

replace jsx-loader to babel-loader #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Switch to the directory containing `webpack.config.js` and run:

## 4. Compile-to-JS languages

webpack's equivalent of browserify transforms and RequireJS plugins is a **loader**. Here's how you can teach webpack to load CoffeeScript and Facebook JSX+ES6 support (you must `npm install jsx-loader coffee-loader`):
webpack's equivalent of browserify transforms and RequireJS plugins is a **loader**. Here's how you can teach webpack to load CoffeeScript and Facebook JSX+ES6 support (you must `npm install babel-loader coffee-loader`):

```js
// webpack.config.js
Expand All @@ -72,7 +72,7 @@ module.exports = {
module: {
loaders: [
{ test: /\.coffee$/, loader: 'coffee-loader' },
{ test: /\.js$/, loader: 'jsx-loader?harmony' } // loaders can take parameters as a querystring
{ test: /\.js$/, loader: 'babel-loader?stage=0' } // loaders can take parameters as a querystring
]
}
};
Expand Down
2 changes: 0 additions & 2 deletions example/modules/About.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx React.DOM */

var React = require('react');

var About = React.createClass({
Expand Down
2 changes: 0 additions & 2 deletions example/modules/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx React.DOM */

var React = require('react');
var {Link, RouteHandler} = require('react-router');

Expand Down
2 changes: 0 additions & 2 deletions example/modules/Home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx React.DOM */

var React = require('react');

var Home = React.createClass({
Expand Down
2 changes: 0 additions & 2 deletions example/modules/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx React.DOM */

var App = require('./App');
var Home = require('./Home');
var About = require('./About');
Expand Down
9 changes: 6 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^5.6.15",
"babel-loader": "^5.2.2",
"bundle-loader": "^0.5.0",
"css-loader": "^0.9.0",
"file-loader": "^0.7.2",
"jsx-loader": "^0.11.0",
"less": "^1.7.5",
"less-loader": "^0.7.7",
"node-libs-browser": "^0.5.2",
"style-loader": "^0.8.0",
"url-loader": "^0.5.5",
"webpack": "^1.9.13",
"webpack-dev-server": "^1.6.5"
},
"dependencies": {
"react": "git://github.com/facebook/react.git#master",
"react-router": "git://github.com/rackt/react-router.git#master"
"react": "^0.13.3",
"react-router": "^0.13.3"
}
}
2 changes: 1 addition & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
},
module: {
loaders: [
{ test: /\.js$/, loader: 'jsx-loader?harmony' },
{ test: /\.js$/, loader: 'babel' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' }, // use ! to chain loaders
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' } // inline base64 URLs for <=8k images, direct URLs for the rest
Expand Down