Skip to content

Commit

Permalink
build: disallow JS, separate ES6 module build
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Rodrigues committed Jul 23, 2020
1 parent 21b9314 commit 651b3d9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"rollup-plugin-uglify": "6.0.4",
"standard-version": "8.0.2",
"ts-jest": "26.1.3",
"tslib": "2.0.0",
"typescript": "3.9.7"
},
"dependencies": {
Expand Down
18 changes: 18 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ export default [
file: pkg.main,
format: 'cjs',
},
],
},
{
input: 'src/index.ts',
external: Object.keys(pkg.dependencies),
plugins: [
typescript({
target: 'ES6',
}),
production &&
terser({
output: {
comments: false,
},
}),
],
context: 'window',
output: [
{
exports: 'named',
file: pkg.module,
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"compilerOptions": {
"target": "ES5",
"lib": ["DOM", "ESNext"],
"module": "ESNext",
"moduleResolution": "Node",
"declaration": false,
"strict": true,
"esModuleInterop": true,
"noEmitOnError": false,
"allowJs": true,
"allowJs": false,
"checkJs": false,
"skipLibCheck": false,
"incremental": false
"incremental": false,
"importHelpers": false
},
"include": ["./src"]
}
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9072,11 +9072,6 @@ tsconfig-paths@^3.9.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3"
integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==

tslib@^1.8.1, tslib@^1.9.0:
version "1.11.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
Expand Down

0 comments on commit 651b3d9

Please sign in to comment.