Skip to content

Commit 9f61c9a

Browse files
committed
Update Webpack sample to correctly use Babel 6, and build it as part of the build. Closes reactjs#207
1 parent d0b14d3 commit 9f61c9a

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

build.proj

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ of patent rights can be found in the PATENTS file in the same directory.
5757
WorkingDirectory="src/React.Core"
5858
Command="npm install"
5959
/>
60+
<Exec
61+
WorkingDirectory="src/React.Sample.Webpack"
62+
Command="npm install"
63+
/>
6064
</Target>
6165

6266
<Target Name="UpdateVersion">
@@ -110,6 +114,7 @@ of patent rights can be found in the PATENTS file in the same directory.
110114
<Target Name="Build" DependsOnTargets="RestorePackages;UpdateVersion">
111115
<Exec WorkingDirectory="src/React.Core" Command="node_modules/.bin/gulp" />
112116
<MSBuild Projects="$(SolutionFile)" Targets="Rebuild" Properties="Configuration=Release;Platform=Any CPU;NoWarn=1607,7035" />
117+
<Exec WorkingDirectory="src/React.Sample.Webpack" Command="node_modules/.bin/webpack" />
113118
</Target>
114119

115120
<Target Name="ResetAspNetVersion" AfterTargets="Build">

src/React.Sample.Webpack/.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "react"]
3+
}

src/React.Sample.Webpack/package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"author": "",
1010
"license": "BSD",
1111
"devDependencies": {
12-
"babel-core": "^5.8.25",
13-
"babel-loader": "^5.3.2",
14-
"expose-loader": "^0.6.0",
15-
"webpack": "^1.12.2"
12+
"babel-core": "^6.3.17",
13+
"babel-loader": "^6.2.0",
14+
"babel-preset-es2015": "^6.3.13",
15+
"babel-preset-react": "^6.3.13",
16+
"expose-loader": "^0.7.1",
17+
"webpack": "^1.12.9"
1618
}
1719
}

src/React.Sample.Webpack/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
{
2626
test: /\.jsx?$/,
2727
exclude: /node_modules/,
28-
loader: 'babel-loader?loose=all&stage=1'
28+
loader: 'babel'
2929
}
3030
// Uncomment this if you want to use your own version of React instead of the version
3131
// bundled with ReactJS.NET.

0 commit comments

Comments
 (0)