mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-23 14:04:07 +03:00
update to rollup babel 5.3.0 and improve browser test coverage code
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@
|
||||
"@babel/plugin-transform-runtime": "^7.11.0",
|
||||
"@babel/preset-env": "^7.11.0",
|
||||
"@babel/preset-typescript": "^7.10.4",
|
||||
"@rollup/plugin-babel": "^5.2.2",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^17.0.0",
|
||||
"@rollup/plugin-html": "^0.2.0",
|
||||
"@rollup/plugin-inject": "^4.0.2",
|
||||
|
||||
+45
-64
@@ -12,7 +12,6 @@ const chalk = require('chalk');
|
||||
const resolve = require('./resolve.config.json');
|
||||
|
||||
const isTestEnv = process.env.NODE_ENV === 'test';
|
||||
const sizeSnapshotFilename = 'rollup.sizeSnapshot.json';
|
||||
|
||||
const rollupConfigDefaults = {
|
||||
input: './src/index',
|
||||
@@ -57,34 +56,28 @@ const esmBabelConfig = {
|
||||
],
|
||||
};
|
||||
|
||||
// workaround for https://github.com/rollup/plugins/issues/774
|
||||
const rollupBabelIstanbulSourceMaps = {};
|
||||
const rollupBabelIstanbulGenerateKey = (filename) => (filename ? filename.replace(/[\\/]+/g, '') : '');
|
||||
const rollupBabelPlugin = isTestEnv
|
||||
? createBabelInputPluginFactory(() => {
|
||||
return {
|
||||
config(cfg) {
|
||||
const { options } = cfg;
|
||||
const { filename, plugins } = options;
|
||||
const istanbulSourceMap = rollupBabelIstanbulSourceMaps[rollupBabelIstanbulGenerateKey(filename)];
|
||||
const { plugins } = options;
|
||||
|
||||
if (istanbulSourceMap) {
|
||||
return {
|
||||
...options,
|
||||
plugins: [
|
||||
...(plugins || []),
|
||||
[
|
||||
'babel-plugin-istanbul',
|
||||
{
|
||||
useInlineSourceMaps: false,
|
||||
inputSourceMap: istanbulSourceMap,
|
||||
},
|
||||
return this.meta.watchMode
|
||||
? options
|
||||
: {
|
||||
...options,
|
||||
plugins: [
|
||||
...(plugins || []),
|
||||
[
|
||||
'babel-plugin-istanbul',
|
||||
{
|
||||
useInlineSourceMaps: false,
|
||||
inputSourceMap: { ...this.getCombinedSourcemap() },
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
};
|
||||
} else {
|
||||
return options;
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
})
|
||||
@@ -229,29 +222,15 @@ const rollupConfig = (config = {}, { project = process.cwd(), overwrite = {}, si
|
||||
sourceMap: sourcemap,
|
||||
extensions: resolve.extensions,
|
||||
}),
|
||||
babel: [
|
||||
isTestEnv
|
||||
? {
|
||||
name: 'collect-bable-plugin-istanbul-input-source-maps',
|
||||
transform(code, filename) {
|
||||
rollupBabelIstanbulSourceMaps[rollupBabelIstanbulGenerateKey(filename)] = { ...this.getCombinedSourcemap() };
|
||||
return {
|
||||
code,
|
||||
map: null,
|
||||
};
|
||||
},
|
||||
}
|
||||
: {},
|
||||
rollupBabelPlugin({
|
||||
...(esm ? esmBabelConfig : legacyBabelConfig),
|
||||
babelHelpers: 'runtime',
|
||||
extensions: resolve.extensions,
|
||||
shouldPrintComment: () => false,
|
||||
caller: {
|
||||
name: 'babel-rollup-build',
|
||||
},
|
||||
}),
|
||||
],
|
||||
babel: rollupBabelPlugin({
|
||||
...(esm ? esmBabelConfig : legacyBabelConfig),
|
||||
babelHelpers: 'runtime',
|
||||
extensions: resolve.extensions,
|
||||
shouldPrintComment: () => false,
|
||||
caller: {
|
||||
name: 'babel-rollup-build',
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
const output = genOutputConfig(esm);
|
||||
@@ -259,26 +238,28 @@ const rollupConfig = (config = {}, { project = process.cwd(), overwrite = {}, si
|
||||
input: inputPath,
|
||||
output: [output].concat(
|
||||
minVersions
|
||||
? {
|
||||
...output,
|
||||
compact: true,
|
||||
file: output.file.replace('.js', '.min.js'),
|
||||
sourcemap: false,
|
||||
plugins: [
|
||||
...(output.plugins || []),
|
||||
rollupTerser({
|
||||
ecma: 8,
|
||||
safari10: true,
|
||||
mangle: {
|
||||
? [
|
||||
{
|
||||
...output,
|
||||
compact: true,
|
||||
file: output.file.replace('.js', '.min.js'),
|
||||
sourcemap: false,
|
||||
plugins: [
|
||||
...(output.plugins || []),
|
||||
rollupTerser({
|
||||
ecma: 8,
|
||||
safari10: true,
|
||||
properties: {
|
||||
regex: /^_/,
|
||||
mangle: {
|
||||
safari10: true,
|
||||
properties: {
|
||||
regex: /^_/,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
}
|
||||
: {}
|
||||
}),
|
||||
],
|
||||
},
|
||||
]
|
||||
: []
|
||||
),
|
||||
external: [...Object.keys(devDependencies), ...Object.keys(peerDependencies), ...((Array.isArray(external) && external) || [])],
|
||||
plugins: pipeline.reduce((arr, item) => {
|
||||
@@ -304,7 +285,7 @@ const rollupConfig = (config = {}, { project = process.cwd(), overwrite = {}, si
|
||||
.filter((build) => build !== null)
|
||||
.map((build, index, buildsArr) => {
|
||||
if (index === 0) {
|
||||
existingDistFilesStats = { ...readFilesStats(distPath) };
|
||||
existingDistFilesStats = readFilesStats(distPath);
|
||||
buildsArr.forEach((build) => {
|
||||
const { output } = build;
|
||||
outputs += Array.isArray(output) ? output.length : 1;
|
||||
|
||||
@@ -1221,10 +1221,10 @@
|
||||
"@nodelib/fs.scandir" "2.1.3"
|
||||
fastq "^1.6.0"
|
||||
|
||||
"@rollup/plugin-babel@^5.2.2":
|
||||
version "5.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.2.2.tgz#e5623a01dd8e37e004ba87f2de218c611727d9b2"
|
||||
integrity sha512-MjmH7GvFT4TW8xFdIeFS3wqIX646y5tACdxkTO+khbHvS3ZcVJL6vkAHLw2wqPmkhwCfWHoNsp15VYNwW6JEJA==
|
||||
"@rollup/plugin-babel@^5.3.0":
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879"
|
||||
integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==
|
||||
dependencies:
|
||||
"@babel/helper-module-imports" "^7.10.4"
|
||||
"@rollup/pluginutils" "^3.1.0"
|
||||
|
||||
Reference in New Issue
Block a user