Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(541) >> yarn build:dist
Using globally installed version of Yarn
yarn build:dist v0.18.1
$ rollup -c dist/rollup.config.js
⚠️ 'default' is imported from external module 'rollup-plugin-node-builtins' but never used
⚠️ 'default' is imported from external module 'rollup-plugin-node-globals' but never used
⚠️ 'default' is imported from external module 'rollup-plugin-real-babili' but never used
⚠️ 'fs' is imported by bin/prettier.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'fs' is imported by node_modules/glob/glob.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'fs' is imported by node_modules/fs.realpath/index.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'path' is imported by node_modules/fs.realpath/old.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'fs' is imported by node_modules/fs.realpath/old.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'path' is imported by commonjs-external:path, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'fs' is imported by commonjs-external:fs, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'path' is imported by node_modules/minimatch/minimatch.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'util' is imported by node_modules/inherits/inherits.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'util' is imported by commonjs-external:util, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'events' is imported by node_modules/glob/glob.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'path' is imported by node_modules/glob/glob.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by node_modules/glob/glob.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'fs' is imported by node_modules/glob/sync.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'util' is imported by node_modules/glob/sync.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'path' is imported by node_modules/glob/sync.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by node_modules/glob/sync.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'path' is imported by node_modules/glob/common.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by commonjs-external:assert, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'util' is imported by node_modules/glob/glob.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'events' is imported by commonjs-external:events, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'readline' is imported by bin/prettier.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by src/comments.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by src/util.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by src/printer.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'assert' is imported by src/fast-path.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'readline' is imported by commonjs-external:readline, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ Creating a browser bundle that depends on Node.js built-in modules ('path', 'util', 'events' and 'assert'). You might need to include https://www.npmjs.com/package/rollup-plugin-node-builtins
⚠️ No name was provided for external module 'fs' in options.globals – guessing 'fs'
⚠️ No name was provided for external module 'path' in options.globals – guessing 'require$$0'
⚠️ No name was provided for external module 'util' in options.globals – guessing 'util'
⚠️ No name was provided for external module 'events' in options.globals – guessing 'events'
⚠️ No name was provided for external module 'assert' in options.globals – guessing 'require$$0$1'
⚠️ No name was provided for external module 'readline' in options.globals – guessing 'readline'
✨ Done in 2.86s.
[/Users/vjeux/random/prettier] [vjeux@vjeux-mbp]
(541) >> node dist/bin.prettier.min.js
/Users/vjeux/random/prettier/dist/bin.prettier.min.js:29034
}(fs,require$$0,util,events,require$$0$1,readline));
^
ReferenceError: fs is not defined
at Object.<anonymous> (/Users/vjeux/random/prettier/dist/bin.prettier.min.js:29034:3)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.runMain (module.js:607:10)
at run (bootstrap_node.js:382:7)
at startup (bootstrap_node.js:137:9)
at bootstrap_node.js:497:3
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import babili from 'rollup-plugin-real-babili';
import json from 'rollup-plugin-json';
export default {
entry: 'bin/prettier.js',
dest: 'dist/bin.prettier.min.js',
format: 'iife',
plugins: [
json(),
resolve(),
commonjs(),
// babili({comments: false, sourceMap: false}),
],
useStrict: false,
moduleName: 'prettier',
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment