Skip to content

Commit 4f68372

Browse files
committed
fix: update build scripts and enhance Rollup configuration
1 parent a173bc4 commit 4f68372

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
2121
"test": "npm run compile && wtr --coverage",
2222
"test:watch": "npm run compile && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch --coverage\"",
23-
"compile": "tsc",
24-
"build": "rimraf dist && npm run compile && rollup -c rollup.config.js",
23+
"compile": "rimraf dist && tsc --emitDeclarationOnly",
24+
"build": "npm run compile && rollup -c rollup.config.js",
2525
"start:build": "web-dev-server --root-dir dist --app-index index.html --open",
2626
"analyze": "cem analyze --litelement",
2727
"start": "npm run compile && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",

rollup.config.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
21
import nodeResolve from '@rollup/plugin-node-resolve';
2+
import babel from '@rollup/plugin-babel';
33
import typescript from '@rollup/plugin-typescript';
44
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
5+
import { terser } from 'rollup-plugin-terser';
56

67
export default {
78
input: './scl-template-update.ts',
@@ -10,10 +11,26 @@ export default {
1011
format: 'es',
1112
dir: 'dist',
1213
},
13-
preserveEntrySignatures: 'strict',
1414
plugins: [
15-
nodeResolve(),
1615
typescript(),
17-
importMetaAssets()
16+
nodeResolve(),
17+
terser(),
18+
importMetaAssets(),
19+
babel({
20+
babelHelpers: 'bundled',
21+
presets: [
22+
[
23+
require.resolve('@babel/preset-env'),
24+
{
25+
targets: [
26+
'last 3 Chrome major versions',
27+
'last 3 Firefox major versions',
28+
'last 3 Edge major versions',
29+
'last 3 Safari major versions',
30+
],
31+
},
32+
],
33+
],
34+
}),
1835
],
1936
};

0 commit comments

Comments
 (0)