Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse webpack/Babel to compile react-tools.js #16
Merged
Conversation
| var path = require('path'); | ||
|
|
||
| module.exports = { | ||
| entry: path.join(__dirname, 'srcjs', 'react-tools.js'), |
timelyportfolio
Feb 9, 2019
Collaborator
Should we add mode: 'development', since react-tools.js is so small? Or do you plan to import lots of code? I prefer to have a non-minified file since some authors might not be as familiar with debugging using a sourcemap.
Should we add mode: 'development', since react-tools.js is so small? Or do you plan to import lots of code? I prefer to have a non-minified file since some authors might not be as familiar with debugging using a sourcemap.
alandipert
Feb 11, 2019
Author
Collaborator
@timelyportfolio makes sense; and I have no plans to import code. I pushed an edit to webpack.config.js and built new inst/ JS.
@timelyportfolio makes sense; and I have no plans to import code. I pushed an edit to webpack.config.js and built new inst/ JS.
|
Thanks @alandipert!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
We'd previously introduced a
package.jsonto support our JS unit tests; this PR adds a coupledevDependenciesand upgrades a few others. Ayarn installwill be required after merging sincepackage.jsonandyarn.lockhave changed.JS testing is still performed the same way, by running
yarn test.In addition, the following files were added:
srcjs/react-tools.js: This is the input file to Babel's transformations. Runningyarn run webpackcompiles this file intoinst/www/react-tools/react-tools.jswhich was previously hand-edited but should still be version-controlled. After this PR, it should not be edited by hand. I copied the source file to its new location without changing any syntax. I figure we can do that moving forward, incrementally, since we'll have support for it.inst/www/react-tools/react-tools.js.map: Source map that corresponds toreact-tools.js.mapand improves the debugging experience. Should also be version-controlled.webpack.config.js: We used to have a webpack configuration, but it was embedded inkarma.conf.jsand used only for building the tests. Now, it's a separate file, and contains some additional configuration.karma.conf.jsdoes not duplicate this configuration. Instead, it importswebpack.config.jsas a module and refers to itsmoduleconfiguration property. This means that changes to the webpack configuration can be made in one place and they should be picked up both when building release JS and when testing JS.