Skip to content
This repository was archived by the owner on Jan 2, 2018. It is now read-only.

Commit ba9bf2a

Browse files
committed
Updated to use the new Babel management system
1 parent 147ecd6 commit ba9bf2a

4 files changed

Lines changed: 26 additions & 38 deletions

File tree

extensions/roc-plugin-react-dev/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
],
2424
"license": "MIT",
2525
"dependencies": {
26-
"roc-plugin-react": "1.0.0-beta.1",
2726
"babel-plugin-react-transform": "~2.0.0",
2827
"babel-preset-react": "~6.3.13",
2928
"react-transform-catch-errors": "~1.0.2",
Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import webpack from '../webpack';
2-
31
export default {
4-
plugins: [require.resolve('roc-plugin-react')],
52
config: {
63
settings: {
74
dev: {
@@ -12,8 +9,30 @@ export default {
129
},
1310
},
1411
actions: [{
15-
hook: 'build-webpack',
16-
description: 'Adds the needed Webpack configuration to be able to build and develop React code.',
17-
action: webpack,
12+
hook: 'babel-config',
13+
description: 'Adds the needed Babel configuration to be able to build and develop React code.',
14+
action: ({ context: { config } }) => (target) => (babelConfig) => {
15+
babelConfig.presets.push(require.resolve('babel-preset-react'));
16+
17+
if (target === 'web' && config.settings.build.mode === 'dev') {
18+
babelConfig.plugins.push([
19+
require.resolve('babel-plugin-react-transform'), {
20+
transforms: [
21+
{
22+
transform: require.resolve('react-transform-hmr'),
23+
imports: ['react'],
24+
locals: ['module'],
25+
},
26+
{
27+
transform: require.resolve('react-transform-catch-errors'),
28+
imports: ['react', require.resolve('redbox-react')],
29+
},
30+
],
31+
},
32+
]);
33+
}
34+
35+
return babelConfig;
36+
},
1837
}],
1938
};

extensions/roc-plugin-react-dev/src/webpack/index.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

extensions/roc-plugin-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"react": "~15.0.1",
2727
"react-dom": "~15.0.1",
28-
"roc": "1.0.0-rc.11"
28+
"roc": "^1.0.0-rc.12"
2929
},
3030
"devDependencies": {
3131
"babel-eslint": "~6.1.2",

0 commit comments

Comments
 (0)