Skip to content
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

Rollup and Sanctuary #707

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@
//. const $ = window.sanctuaryDef;
//. // ...
//. ```
//. If you are using rollup in your project, where you have integrated Sanctuary, you might
//. get errors. Please import builtins and globals from rollup-plugin-node-builtins and
//. rollup-plugin-node-globals respectively, in the rollup config file. These are needed to add
//. the utils folder, which is referenced in the sanctuary code.
Comment on lines +337 to +340
Copy link
Member

Choose a reason for hiding this comment

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

This is great! Could you share the snippet from your Rollup config file? Perhaps we could include that here.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, sure. Here is my rollup.config file for a simple project, where I've used Sanctuary and rollup:

import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';

export default {
input: './src/main.js',
output: {
file: './build/bundle.min.js',
format: 'iife',
name: 'bundle'
},
plugins: [
nodeResolve({ preferBuiltins: false }), // or true
commonjs(),
globals(),
builtins()]
}
;

//.
//. ## API

Expand Down