Skip to content

Commit

Permalink
Add banner directive to rollup config (#162)
Browse files Browse the repository at this point in the history
* Add banner directive to rollup config

Issue #161

* Remove redundant rollup config comment
  • Loading branch information
cravend authored Feb 8, 2023
1 parent aaee885 commit 0eb9eca
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,29 @@ export default {
* non-builtin CommonJS modules in Node correctly.
*/
interop: 'defaultOnly',
/**
* This is required to prevent the error:
*
* TypeError: createContext only works in Client Components.
* Add the "use client" directive at the top of the file to use it.
*
* -----
*
* Here is the Rollup documentation on `banner`:
* A string to prepend/append to the bundle. You can also
* supply a function that returns a Promise that resolves
* to a string to generate it asynchronously
*
* (Note: banner and footer options will not
* break sourcemaps).
*/
banner: "'use client';",
},
{
dir: 'dist',
format: 'cjs',
exports: 'named',
banner: "'use client';",
},
],
plugins: [
Expand Down

0 comments on commit 0eb9eca

Please sign in to comment.