vue-sfc-rollup
Advanced tools
Comparing version 4.0.4 to 4.0.5
@@ -7,5 +7,12 @@ # Changelog | ||
## [4.0.4] - 2021-03-19 | ||
## [4.0.5] - 2021-04-12 | ||
### Fixed | ||
- Move commonjs plugin before babel, as per babel docs | ||
- Import babel.config.js and merge with custom es build opts, avoiding duplication | ||
- Includes example of optional chaining/nullish coalescing config | ||
## [4.0.4] - 2021-03-20 | ||
### Fixed | ||
- Fixed plugin-order bug introduced by 4.0.3 | ||
@@ -12,0 +19,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"license": "ISC", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"bin": { | ||
@@ -9,0 +9,0 @@ "sfc-init": "./sfc-init.js" |
const devPresets = ['@vue/babel-preset-app']; | ||
const buildPresets = ['@babel/preset-env'<% if (ts) { -%>, '@babel/preset-typescript'<% } -%>]; | ||
const buildPresets = [ | ||
[ | ||
'@babel/preset-env', | ||
// Config for @babel/preset-env | ||
{ | ||
// Example: Always transpile optional chaining/nullish coalescing | ||
// include: [ | ||
// /(optional-chaining|nullish-coalescing)/ | ||
// ], | ||
}, | ||
], | ||
<% if (ts) { -%> | ||
'@babel/preset-typescript', | ||
<% } -%> | ||
]; | ||
module.exports = { | ||
presets: (process.env.NODE_ENV === 'development' ? devPresets : buildPresets), | ||
}; |
@@ -22,2 +22,6 @@ // rollup.config.js | ||
// Extract babel preset-env config, to combine with esbrowserslist | ||
const babelPresetEnvConfig = require('../babel.config') | ||
.presets.filter((entry) => entry[0] === '@babel/preset-env')[0][1]; | ||
const argv = minimist(process.argv.slice(2)); | ||
@@ -66,2 +70,3 @@ | ||
<% } -%> | ||
commonjs(), | ||
], | ||
@@ -115,2 +120,3 @@ babel: { | ||
{ | ||
...babelPresetEnvConfig, | ||
targets: esbrowserslist, | ||
@@ -121,3 +127,2 @@ }, | ||
}), | ||
commonjs(), | ||
], | ||
@@ -156,3 +161,2 @@ }; | ||
babel(baseConfig.plugins.babel), | ||
commonjs(), | ||
], | ||
@@ -181,3 +185,2 @@ }; | ||
babel(baseConfig.plugins.babel), | ||
commonjs(), | ||
terser({ | ||
@@ -184,0 +187,0 @@ output: { |
const devPresets = ['@vue/babel-preset-app']; | ||
const buildPresets = ['@babel/preset-env'<% if (ts) { -%>, '@babel/preset-typescript'<% } -%>]; | ||
const buildPresets = [ | ||
[ | ||
'@babel/preset-env', | ||
// Config for @babel/preset-env | ||
{ | ||
// Example: Always transpile optional chaining/nullish coalescing | ||
// include: [ | ||
// /(optional-chaining|nullish-coalescing)/ | ||
// ], | ||
}, | ||
], | ||
<% if (ts) { -%> | ||
'@babel/preset-typescript', | ||
<% } -%> | ||
]; | ||
module.exports = { | ||
presets: (process.env.NODE_ENV === 'development' ? devPresets : buildPresets), | ||
}; |
@@ -22,2 +22,6 @@ // rollup.config.js | ||
// Extract babel preset-env config, to combine with esbrowserslist | ||
const babelPresetEnvConfig = require('../babel.config') | ||
.presets.filter((entry) => entry[0] === '@babel/preset-env')[0][1]; | ||
const argv = minimist(process.argv.slice(2)); | ||
@@ -66,2 +70,3 @@ | ||
<% } -%> | ||
commonjs(), | ||
], | ||
@@ -115,2 +120,3 @@ babel: { | ||
{ | ||
...babelPresetEnvConfig, | ||
targets: esbrowserslist, | ||
@@ -121,3 +127,2 @@ }, | ||
}), | ||
commonjs(), | ||
], | ||
@@ -156,3 +161,2 @@ }; | ||
babel(baseConfig.plugins.babel), | ||
commonjs(), | ||
], | ||
@@ -181,3 +185,2 @@ }; | ||
babel(baseConfig.plugins.babel), | ||
commonjs(), | ||
terser({ | ||
@@ -184,0 +187,0 @@ output: { |
60797
968