Skip to content

Commit 0f71411

Browse files
committed
First cut, using webpack to build react-tools.js
1 parent e9300e5 commit 0f71411

File tree

8 files changed

+1005
-741
lines changed

8 files changed

+1005
-741
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
inst/doc
66
node_modules
77
reactR.Rcheck
8-
reactR_*.tar.gz
8+
reactR_*.tar.gz
9+
*.swp

inst/www/react-tools/react-tools.js

Lines changed: 2 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/react-tools/react-tools.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

karma.conf.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const webpackConfig = require('./webpack.config.js');
2+
13
module.exports = function (config) {
24
config.set({
35
frameworks: ['mocha', 'chai', 'source-map-support'],
@@ -7,18 +9,7 @@ module.exports = function (config) {
79
'js-tests/*.jsx': ['webpack']
810
},
911
webpack: {
10-
module: {
11-
rules: [
12-
{
13-
test: [/\.js$/, /\.jsx$/],
14-
loader: 'babel-loader',
15-
options: {
16-
presets: ['@babel/preset-env', '@babel/preset-react']
17-
}
18-
}
19-
]
20-
},
21-
devtool: 'inline-source-map'
12+
module: webpackConfig.module
2213
},
2314
webpackMiddleware: {
2415
stats: 'errors-only'
@@ -32,4 +23,4 @@ module.exports = function (config) {
3223
// singleRun: false, // Karma captures browsers, runs the tests and exits
3324
concurrency: Infinity
3425
})
35-
}
26+
}

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
"karma-chai": "^0.1.0",
66
"karma-chrome-launcher": "^2.2.0",
77
"karma-mocha": "^1.3.0",
8-
"karma-webpack": "^3.0.5",
8+
"karma-webpack": "^4.0.0-rc.6",
99
"karma-source-map-support": "^1.3.0",
1010
"mocha": "^5.2.0",
1111
"react": "^16.7.0",
1212
"react-dom": "^16.7.0",
13-
"webpack": "^3.0.0",
14-
"@babel/core": "^7.2.0",
15-
"babel-loader": "^8.0.4",
16-
"@babel/preset-env": "^7.2.0",
13+
"webpack": "^4.27.1",
14+
"webpack-cli": "^3.1.2",
15+
"@babel/core": "^7.2.2",
16+
"babel-loader": "^8.0.5",
17+
"@babel/preset-env": "^7.3.1",
1718
"@babel/preset-react": "^7.0.0",
1819
"@rgrove/parse-xml": "^1.1.1",
1920
"react-html-parser": "^2.0.2"
2021
},
2122
"scripts": {
2223
"test": "karma start --single-run --browsers ChromeHeadless karma.conf.js"
2324
}
24-
}
25+
}

0 commit comments

Comments
 (0)