mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-21 00:01:40 +03:00
add treeshaking tests
This commit is contained in:
@@ -107,22 +107,30 @@ const createConfig = (userOptions = {}) => {
|
||||
const options = mergeAndResolveOptions(userOptions);
|
||||
const { project, mode, extractTypes, extractStyles, verbose } = options;
|
||||
const isBuild = mode === 'build';
|
||||
|
||||
if (verbose) {
|
||||
console.log('');
|
||||
console.log('PROJECT : ', project);
|
||||
console.log('OPTIONS : ', options);
|
||||
}
|
||||
let result;
|
||||
|
||||
if (isBuild) {
|
||||
const styles = extractStyles && pipelineStyles(resolve, options);
|
||||
const types = extractTypes && pipelineTypes(resolve, options);
|
||||
const js = pipelineBuild(resolve, options);
|
||||
|
||||
return [styles, types, js].flat().filter((build) => !!build);
|
||||
result = [styles, types, js].flat().filter((build) => !!build);
|
||||
} else {
|
||||
result = [pipelineDev(resolve, options)];
|
||||
}
|
||||
|
||||
return [pipelineDev(resolve, options)];
|
||||
if (verbose) {
|
||||
result[0].plugins.push({
|
||||
name: 'PROJECT',
|
||||
buildStart() {
|
||||
console.log('');
|
||||
console.log('PROJECT : ', project);
|
||||
console.log('OPTIONS : ', options);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = createConfig;
|
||||
|
||||
@@ -61,10 +61,6 @@ module.exports = (resolve, options) => {
|
||||
return {
|
||||
input,
|
||||
output,
|
||||
treeshake: {
|
||||
propertyReadSideEffects: false,
|
||||
moduleSideEffects: false,
|
||||
},
|
||||
...rollupOptions,
|
||||
plugins: [
|
||||
rollupLicense(banner, sourcemap),
|
||||
|
||||
@@ -87,7 +87,7 @@ module.exports = {
|
||||
['@babel/plugin-proposal-private-methods', { loose: true }],
|
||||
],
|
||||
babelHelpers: 'runtime',
|
||||
shouldPrintComment: () => false,
|
||||
shouldPrintComment: (comment) => /@__PURE__/.test(comment),
|
||||
caller: {
|
||||
name: 'babel-rollup-build',
|
||||
},
|
||||
|
||||
@@ -75,7 +75,6 @@ module.exports = (testDir, mode = 'dev', onListening = null) => {
|
||||
output: {
|
||||
sourcemap: true,
|
||||
},
|
||||
treeshake: true,
|
||||
plugins: [
|
||||
rollupPluginStyles(),
|
||||
rollupPluginHtml(`Playwright: ${name}`, htmlName, () =>
|
||||
|
||||
Reference in New Issue
Block a user