Skip to content

Commit

Permalink
fix(rollup): merged config files
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Mar 9, 2023
1 parent fcf71bd commit 05c22d8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 36 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
dist/*
# Web bundle should always be available on github raw
!dist/index.bundle.js
!dist/index.d.ts

coverage
node_modules
test/IdnaTest.txt
Expand Down
1 change: 1 addition & 0 deletions dist/index.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/index.mjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"description": "A UTS #46 processing algorithm for IDNA2008 strings",
"version": "5.0.2",
"private": false,
"module": "dist/index.mjs",
"main": "dist/index.cjs",
"main": "dist/index",
"typings": "dist/index.d.ts",
"license": "MIT",
"sideEffects": false,
Expand Down Expand Up @@ -43,7 +42,7 @@
"build:unicode-upgrade": "esr scripts/unicode-upgrade.ts",
"build:unicode-checkversion": "esr scripts/unicode-checkversion.ts",
"build:unicode-tables": "esr scripts/build-unicode-tables.ts 15.0.0",
"build:rollup": "rollup -c && rollup -c rollup-esm.config.mjs"
"build:rollup": "rollup -c rollup-esm.config.mjs"
},
"dependencies": {
"punycode": "^2.1.1"
Expand Down
2 changes: 1 addition & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cfg.plugins.unshift([
]);
cfg.plugins = cfg.plugins.map((plugin) => {
if (plugin[0] === '@semantic-release/git') {
plugin[1].assets.push('dist/index.d.ts', 'dist/index.bundle.js');
plugin[1].assets.push('dist/index.d.ts', 'dist/index.mjs');
}
return plugin;
});
Expand Down
21 changes: 20 additions & 1 deletion rollup-esm.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import bundleSize from 'rollup-plugin-bundle-size';

export default {
input: 'src/index.js',
output: [
{
file: 'dist/index.bundle.js',
format: 'iife',
name: 'idnaUts46',
plugins: [terser(), bundleSize()],
},
{
file: 'dist/index.cjs',
format: 'cjs',
plugins: [terser(), bundleSize()],
},
{
file: 'dist/index.mjs',
format: 'es',
plugins: [terser(), bundleSize()],
},
],
external: ['punycode'],
plugins: [
// needed to resolve punycode from import not node's builtin
nodeResolve({ preferBuiltins: false }),
],
};
23 changes: 0 additions & 23 deletions rollup.config.mjs

This file was deleted.

0 comments on commit 05c22d8

Please sign in to comment.