Skip to content

Commit

Permalink
fix: bundle cssesc to be used in the browser (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Jul 4, 2023
1 parent ce76bce commit 1d79942
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 2 deletions.
219 changes: 218 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"license": "Apache-2.0",
"type": "module",
"devDependencies": {
"@rollup/plugin-commonjs": "25.0.2",
"@rollup/plugin-node-resolve": "15.1.0",
"@rollup/plugin-typescript": "9.0.1",
"@types/chai": "4.3.3",
"@types/cssesc": "^3.0.0",
Expand Down
10 changes: 9 additions & 1 deletion rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const typescript = require('@rollup/plugin-typescript').default;
const { nodeResolve } = require('@rollup/plugin-node-resolve').default;
const commonjs = require('@rollup/plugin-commonjs').default;
const dts = require('rollup-plugin-dts').default;
const pkg = require('./package.json');

Expand All @@ -18,7 +20,13 @@ module.exports = [
},
],
external: Object.keys(pkg.peerDependencies),
plugins: [typescript({ module: 'NodeNext' })],
plugins: [
typescript({ module: 'NodeNext' }),
commonjs(),
nodeResolve({
resolveOnly: ['cssesc'],
}),
],
},
{
input: 'src/main.ts',
Expand Down

0 comments on commit 1d79942

Please sign in to comment.