Skip to content

Commit

Permalink
feat(build): use react app babel preset
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Jun 21, 2020
1 parent aecf5b0 commit 18a8dd1
Show file tree
Hide file tree
Showing 5 changed files with 895 additions and 44 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ packages-build: ##@1 packages build all packages
package-build-%: ##@1 packages build a package
@echo "${YELLOW}Building package ${WHITE}@nivo/${*}${RESET}"
@rm -rf ./packages/${*}/dist
@export PACKAGE=${*}; ./node_modules/.bin/rollup -c conf/rollup.config.js
@export PACKAGE=${*}; NODE_ENV=production BABEL_ENV=production ./node_modules/.bin/rollup -c conf/rollup.config.js

packages-screenshots: ##@1 packages generate screenshots for packages readme (website dev server must be running)
@node scripts/capture.js
Expand All @@ -196,7 +196,7 @@ package-watch-%: ##@1 packages build package (es flavor) on change, eg. `package
@echo "${YELLOW}Running build watcher for package ${WHITE}@nivo/${*}${RESET}"
@rm -rf ./packages/${*}/cjs
@rm -rf ./packages/${*}/umd
@export PACKAGE=${*}; ./node_modules/.bin/rollup -c conf/rollup.config.js -w
@export PACKAGE=${*}; NODE_ENV=development BABEL_ENV=development ./node_modules/.bin/rollup -c conf/rollup.config.js -w

package-dev-%: ##@1 packages setup package for development, link to website, run watcher
@echo "${YELLOW}Preparing package ${WHITE}${*}${YELLOW} for development${RESET}"
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['@nivo/babel-preset']
presets: ['react-app']
}
6 changes: 2 additions & 4 deletions conf/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const commonPlugins = [
}),
babel({
exclude: 'node_modules/**',
babelHelpers: 'bundled',
presets: [
'@nivo/babel-preset'
]
babelHelpers: 'runtime',
presets: ['react-app']
}),
cleanup()
]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"babel-eslint": "^10.1.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.1.0",
"babel-preset-react-app": "^9.1.2",
"chalk": "^2.4.2",
"clog-cli": "^1.0.0",
"enzyme": "^3.10.0",
Expand Down
Loading

0 comments on commit 18a8dd1

Please sign in to comment.