-
Notifications
You must be signed in to change notification settings - Fork 6
🧟 v3.0.2 #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
🧟 v3.0.2 #233
Changes from all commits
7126906
f3a856c
01d28ba
071f3f2
c83c333
85fefeb
560c75c
c880cac
f99b958
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,15 +8,13 @@ let { nodeResolve } = require("@rollup/plugin-node-resolve"); | |
|
|
||
| let MODULE_FORMATS = { // maps faucet identifiers to Rollup identifiers | ||
| esm: true, | ||
| es: "esm", // alias | ||
| es6: "esm", // alias | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I honestly have no idea why we had those aliases in the first place; "esm" probably wasn't firmly established back then? 👴 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly |
||
| umd: true, | ||
| amd: true, | ||
| commonjs: "cjs", | ||
| cjs: false, // deprecated in favor of `commonjs` | ||
| iife: true | ||
| }; | ||
| let NAMELESS_MODULES = new Set(["es", "amd", "cjs"]); // NB: Rollup identifiers | ||
| let NAMELESS_MODULES = new Set(["esm", "amd", "cjs"]); // NB: Rollup identifiers | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be sure: This should always have been There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is my understanding, yes! |
||
|
|
||
| module.exports = generateConfig; | ||
|
|
||
|
|
@@ -45,9 +43,9 @@ module.exports = generateConfig; | |
| // * `sourcemaps`, if truthy, activates inline source-map generation | ||
| // * `compact`, if truthy, compresses the bundle's code - see `determineCompacting` | ||
| // for compression levels, determined by the respective value | ||
| function generateConfig({ externals, format, exports, // eslint-disable-next-line indent | ||
| esnext, jsx, typescript, // eslint-disable-next-line indent | ||
| sourcemaps, compact }, { browsers }) { | ||
| async function generateConfig({ externals, format, | ||
| exports, esnext, jsx, typescript, // eslint-disable-line indent | ||
| sourcemaps, compact }, { browsers }) { // eslint-disable-line indent | ||
| let cfg = { sourcemap: sourcemaps }; | ||
| let plugins = []; | ||
| let extensions = [".js"]; | ||
|
|
@@ -75,11 +73,11 @@ function generateConfig({ externals, format, exports, // eslint-disable-next-lin | |
| console.error("transpiling JavaScript for", browsers.join(", ")); | ||
| } | ||
|
|
||
| let plugin = generateTranspiler(transpiler, { browsers }); | ||
| let plugin = await generateTranspiler(transpiler, { browsers }); | ||
| plugins.push(plugin); | ||
| } | ||
| if(typescript) { | ||
| let ts = loadExtension("@rollup/plugin-typescript", | ||
| let ts = await loadExtension("@rollup/plugin-typescript", | ||
| "failed to activate TypeScript", "faucet-pipeline-typescript"); | ||
| extensions.push(".ts"); | ||
| // TODO: provide defaults and abstractions for low-level options? | ||
|
|
@@ -92,7 +90,7 @@ function generateConfig({ externals, format, exports, // eslint-disable-next-lin | |
| ]); | ||
| if(compact) { | ||
| cfg.compact = true; | ||
| plugins = plugins.concat(determineCompacting(compact)); | ||
| plugins = plugins.concat(await determineCompacting(compact)); | ||
| } | ||
| cfg.plugins = plugins; | ||
|
|
||
|
|
@@ -138,7 +136,7 @@ function determineModuleFormat(format = "esm") { | |
| } | ||
| } | ||
|
|
||
| function determineCompacting(type = true) { | ||
| async function determineCompacting(type = true) { | ||
| switch(type) { | ||
| case true: // default | ||
| case "compact": | ||
|
|
@@ -153,7 +151,7 @@ function determineCompacting(type = true) { | |
| abort(`unknown compacting option ${type}`); | ||
| } | ||
|
|
||
| let terser = loadExtension("@rollup/plugin-terser", | ||
| let terser = await loadExtension("@rollup/plugin-terser", | ||
| "failed to activate minification", "faucet-pipeline-jsmin"); | ||
| return terser(options); | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will go for 3.1.0, right?