diff --git a/.gitignore b/.gitignore
index c0b598a5..047a35e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,4 @@
/node_modules/
/lib/
/test/
-
-# top level source
-my-element.js
-my-element.js.map
-my-element.d.ts
-my-element.d.ts.map
+/dist/
diff --git a/dev/index.html b/dev/index.html
index 8e27df24..560f284a 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -1,20 +1,23 @@
-
-
- <my-element> Demo
-
-
-
-
-
- This is child content
-
-
+
+
+
+ <my-element> Demo
+
+
+
+
+
+
+ This is child content
+
+
+
diff --git a/karma.conf.cjs b/karma.conf.cjs
index adfc4bd6..1d9470f9 100644
--- a/karma.conf.cjs
+++ b/karma.conf.cjs
@@ -10,7 +10,7 @@ module.exports = (config) => {
},
files: [
{
- pattern: config.grep ? config.grep : 'test/**/*_test.js',
+ pattern: config.grep ? config.grep : 'dist/test/**/*_test.js',
type: 'module',
},
],
diff --git a/package.json b/package.json
index 72a7225f..8bca7a99 100644
--- a/package.json
+++ b/package.json
@@ -2,19 +2,19 @@
"name": "lit-element-starter-ts",
"version": "0.0.0",
"description": "A simple web component",
- "main": "my-element.js",
- "module": "my-element.js",
+ "main": "./dist/my-element.js",
+ "module": "./dist/my-element.js",
"type": "module",
"scripts": {
"build": "tsc",
"build:watch": "tsc --watch",
- "clean": "rimraf my-element.{d.ts,d.ts.map,js,js.map} test/my-element.{d.ts,d.ts.map,js,js.map} test/my-element_test.{d.ts,d.ts.map,js,js.map}",
+ "clean": "rimraf dist/",
"lint": "npm run lint:lit-analyzer && npm run lint:eslint",
"lint:eslint": "eslint 'src/**/*.ts'",
"lint:lit-analyzer": "lit-analyzer",
"format": "prettier src/* --write",
"docs": "npm run docs:clean && npm run build && npm run analyze && npm run docs:build && npm run docs:assets && npm run docs:gen",
- "docs:clean": "rimraf docs",
+ "docs:clean": "rimraf docs/",
"docs:gen": "eleventy --config=.eleventy.cjs",
"docs:gen:watch": "eleventy --config=.eleventy.cjs --watch",
"docs:build": "rollup -c --file docs/my-element.bundled.js",
@@ -26,7 +26,7 @@
"test:watch": "karma start karma.conf.cjs --auto-watch=true --single-run=false",
"test:update-snapshots": "karma start karma.conf.cjs --update-snapshots",
"test:prune-snapshots": "karma start karma.conf.cjs --prune-snapshots",
- "checksize": "rollup -c ; cat my-element.bundled.js | gzip -9 | wc -c ; rm my-element.bundled.js"
+ "checksize": "rollup -c ; cat ./dist/my-element.bundled.js | gzip -9 | wc -c ; rm ./dist/my-element.bundled.js"
},
"keywords": [
"web-components",
diff --git a/rollup.config.js b/rollup.config.js
index ef00cc62..68d93162 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -12,15 +12,15 @@
* http://polymer.github.io/PATENTS.txt
*/
+import replace from '@rollup/plugin-replace';
import filesize from 'rollup-plugin-filesize';
-import {terser} from 'rollup-plugin-terser';
import resolve from 'rollup-plugin-node-resolve';
-import replace from '@rollup/plugin-replace';
+import {terser} from 'rollup-plugin-terser';
export default {
- input: 'my-element.js',
+ input: 'dist/my-element.js',
output: {
- file: 'my-element.bundled.js',
+ file: 'dist/my-element.bundled.js',
format: 'esm',
},
onwarn(warning) {
diff --git a/tsconfig.json b/tsconfig.json
index 6c2d84ea..11ed9df2 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -6,7 +6,7 @@
"declaration": true,
"declarationMap": true,
"sourceMap": true,
- "outDir": "./",
+ "outDir": "./dist",
"rootDir": "./src",
"strict": true,
"noUnusedLocals": true,