Skip to content
Closed

v3.1 #235

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/bundle/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function generateConfig({ externals, format, exports, // eslint-disable-next-lin
if(esnext || jsx) {
let transpiler = Object.assign({}, esnext, jsx);
if(esnext) {
console.error("WARNING: \"esnext\" is deprecated");
transpiler.esnext = true;
}
if(jsx) {
Expand Down Expand Up @@ -96,6 +97,10 @@ function generateConfig({ externals, format, exports, // eslint-disable-next-lin
}
cfg.plugins = plugins;

if(format) {
console.error("WARNING: \"format\" is deprecated.\n" +
"faucet-pipeline-js will always compile to ESM in the future.");
}
cfg.format = determineModuleFormat(format);
if(exports) {
if(NAMELESS_MODULES.has(format)) {
Expand Down Expand Up @@ -147,6 +152,7 @@ function determineCompacting(type = true) {
var options = { compress: false, mangle: false }; // eslint-disable-line no-var
break;
case "mangle":
console.error("WARNING: compact option \"mangle\" is deprecated, use \"minify\"");
options = { compress: false, mangle: true };
break;
default:
Expand Down
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
let Bundle = require("./bundle");
let { abort, repr } = require("faucet-pipeline-core/lib/util");
let path = require("path");
let browserslist = require("browserslist");

module.exports = {
key: "js",
bucket: "scripts",
plugin: faucetJS
};

function faucetJS(config, assetManager, { browsers, compact, sourcemaps } = {}) {
function faucetJS(config, assetManager, { compact, sourcemaps } = {}) {
let browsers = browserslist.findConfig(assetManager.referenceDir) || {};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically just moves the code that is deleted in core in this PR:
https://github.com/faucet-pipeline/faucet-pipeline-core/pull/168/changes

if(browsers.substr) {
browsers = [browsers];
}

let bundlers = config.map(bundleConfig => makeBundler(bundleConfig,
assetManager, { browsers, compact, sourcemaps }));

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"@rollup/plugin-commonjs": "~29.0.1",
"@rollup/plugin-node-resolve": "~16.0.3",
"browserslist": "^4.28.1",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this doesn't add a dependency, as this is currently a transitive dependency via core

"faucet-pipeline-core": "^2.0.0",
"rollup": "^4.59.0",
"rollup-plugin-cleanup": "~3.2.1"
Expand Down
Loading