Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
node: Target the version of Node.js used to run webpack (#991)
Browse files Browse the repository at this point in the history
Instead of always targetting Node.js 8.3. This means users running
newer Node.js will have fewer Babel transforms enabled, reducing
build times and improving runtime performance.

Fixes #985.
  • Loading branch information
edmorley authored Jul 11, 2018
1 parent 797ec28 commit e8dfea6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
## Features

- Zero upfront configuration necessary to start developing and building a Node.js project
- Modern Babel compilation supporting ES modules, Node.js 8.3+, async functions, and dynamic imports
- Modern Babel compilation supporting ES modules, async functions, and dynamic imports
- By default targets the version of Node.js used to run webpack
- Supports automatically-wired sourcemaps
- Tree-shaking to create smaller bundles
- Hot Module Replacement with source-watching during development
Expand Down Expand Up @@ -271,7 +272,8 @@ module.exports = {
// Override options for @babel/preset-env, showing defaults:
presets: [
['@babel/preset-env', {
targets: { node: '8.3' },
// Targets the version of Node.js used to run webpack.
targets: { node: 'current' },
modules: false,
useBuiltIns: true,
}]
Expand Down
3 changes: 2 additions & 1 deletion packages/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module.exports = (neutrino, opts = {}) => {
const options = merge({
hot: true,
targets: {
node: '8.3'
// Targets the version of Node.js used to run webpack.
node: 'current'
},
clean: opts.clean !== false && {
paths: [neutrino.options.output]
Expand Down

0 comments on commit e8dfea6

Please sign in to comment.