2017-06-28 22:37:33 +03:00
|
|
|
import baseConfig from "./rollup.base.config.js";
|
|
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
|
|
import commonjs from "rollup-plugin-commonjs";
|
|
|
|
import json from "rollup-plugin-json";
|
|
|
|
import replace from "rollup-plugin-replace";
|
2017-05-29 07:49:41 +03:00
|
|
|
|
2017-06-08 01:20:48 +03:00
|
|
|
export default Object.assign(baseConfig, {
|
2017-06-28 22:37:33 +03:00
|
|
|
entry: "bin/prettier.js",
|
|
|
|
dest: "dist/bin/prettier.js",
|
|
|
|
format: "cjs",
|
|
|
|
banner: "#!/usr/bin/env node",
|
2017-05-29 07:49:41 +03:00
|
|
|
plugins: [
|
|
|
|
replace({
|
2017-09-29 10:27:50 +03:00
|
|
|
"#!/usr/bin/env node": "",
|
|
|
|
// The require-from-string module (a dependency of cosmiconfig) assumes
|
|
|
|
// that `module.parent` exists, but it only does for `require`:ed modules.
|
|
|
|
// Usually, require-from-string is _always_ `require`:ed, but when bundled
|
|
|
|
// with rollup the module is turned into a plain function located directly
|
|
|
|
// in bin/prettier.js so `module.parent` does not exist. Defaulting to
|
|
|
|
// `module` instead seems to work.
|
|
|
|
"module.parent": "(module.parent || module)"
|
2017-05-29 07:49:41 +03:00
|
|
|
}),
|
|
|
|
json(),
|
2017-06-08 01:20:48 +03:00
|
|
|
resolve({ preferBuiltins: true }),
|
2017-06-28 22:37:33 +03:00
|
|
|
commonjs()
|
2017-05-29 07:49:41 +03:00
|
|
|
],
|
2017-06-28 22:37:33 +03:00
|
|
|
external: ["fs", "readline", "path", "module", "assert", "util", "events"]
|
2017-06-08 01:20:48 +03:00
|
|
|
});
|