Skip to content

Commit

Permalink
perf(build): add build target for Node (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar authored and gregberge committed Mar 13, 2019
1 parent 4c8ae60 commit 97ff6ac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
let targets = {}

if (process.env.BUILD_TARGET === 'node') {
targets = { node: '8' }
}

module.exports = {
presets: ['@babel/preset-react', ['@babel/preset-env', { loose: true }]],
presets: [
['@babel/preset-react', { useBuiltIns: true }],
['@babel/preset-env', { loose: true, targets }],
],
plugins: ['@babel/plugin-proposal-class-properties'],
}
2 changes: 1 addition & 1 deletion packages/babel-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "MIT",
"scripts": {
"prebuild": "shx rm -rf lib",
"build": "babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
"build": "BUILD_TARGET=node babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
"prepublishOnly": "yarn run build"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "MIT",
"scripts": {
"prebuild": "shx rm -rf lib",
"build": "babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
"build": "BUILD_TARGET=node babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
"prepublishOnly": "yarn run build"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "MIT",
"scripts": {
"prebuild": "shx rm -rf lib",
"build": "babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
"build": "BUILD_TARGET=node babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
"prepublishOnly": "yarn run build"
},
"peerDependencies": {
Expand Down

0 comments on commit 97ff6ac

Please sign in to comment.