mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 14:29:19 +00:00

PR-URL: https://github.com/nodejs/node/pull/20109 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
const resolve = require('rollup-plugin-node-resolve');
|
|
const commonjs = require('rollup-plugin-commonjs');
|
|
const json = require('rollup-plugin-json');
|
|
|
|
module.exports = {
|
|
input: 'src/cli-entry.js',
|
|
output: {
|
|
file: 'dist/lint-md.js',
|
|
format: 'cjs',
|
|
sourcemap: false
|
|
},
|
|
external: [
|
|
'stream',
|
|
'path',
|
|
'module',
|
|
'util',
|
|
'tty',
|
|
'os',
|
|
'fs',
|
|
'events',
|
|
'assert'
|
|
],
|
|
plugins: [
|
|
{
|
|
name: 'brute-replace',
|
|
transform(code, id) {
|
|
const normID = id.replace(__dirname, '').replace(/\\+/g, '/');
|
|
if (normID === '/node_modules/concat-stream/index.js') {
|
|
return code.replace('\'readable-stream\'', '\'stream\'');
|
|
}
|
|
if (normID === '/node_modules/unified-args/lib/options.js') {
|
|
return code.replace('\'./schema\'', '\'./schema.json\'');
|
|
}
|
|
}
|
|
},
|
|
json({
|
|
preferConst: true
|
|
}),
|
|
resolve(), // tells Rollup how to find date-fns in node_modules
|
|
commonjs(), // converts date-fns to ES modules
|
|
]
|
|
};
|