-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set output directory to dist #30
base: main
Are you sure you want to change the base?
Conversation
I like this change. Looks good to me. QA: I cherry-picked this into a personal branch at tony#1 |
@arthurevans Thoughts on merging this? This cleans up output and simplifies the build One thing I haven't considered yet is the production build / packaging (via https://github.com/PolymerLabs/lit-element-starter-ts/issues/14#issuecomment-614293152) Would this do the trick? diff --git a/package.json b/package.json
index 570393a..bdda163 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,9 @@
"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",
+ "types": "./dist/my-element.d.ts",
"type": "module",
"scripts": {
"build": "tsc", (I suppose with lit-next also in motion at https://github.com/Polymer/lit-html/tree/lit-next/packages/lit-starter-ts this will be superseded, but in the mean time this is nice!) |
@fvilers Some more places to update: diff --git a/dev/index.html b/dev/index.html
index 3d6ce88..f2659e3 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<title><o-embed> Demo</title>
- <script type="module" src="../o-embed.js"></script>
+ <script type="module" src="../dist/o-embed.js"></script>
<style>
p {
border: solid 1px blue;
diff --git a/package.json b/package.json
index a6c745a..eadfc46 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,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 o-embed.bundled.js | gzip -9 | wc -c ; rm o-embed.bundled.js"
+ "checksize": "rollup -c ; cat dist/o-embed.bundled.js | gzip -9 | wc -c ; rm dist/o-embed.bundled.js"
},
"keywords": [
"web-components",
diff --git a/rollup.config.js b/rollup.config.js
index f17c504..ca0cf21 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -20,7 +20,7 @@ import {terser} from 'rollup-plugin-terser';
export default {
input: 'dist/o-embed.js',
output: {
- file: 'o-embed.bundled.js',
+ file: 'dist/o-embed.bundled.js',
format: 'esm',
},
onwarn(warning) { |
See also: lit#30
Sorry this didn't get reviewed earlier. I don't think I'm really the person to make this call. @kevinpschaaf was updating the lit-next version and may have thoughts. |
FWIW I agree it makes the whole thing cleaner. If I recall correctly, we originally didn't have a |
Noted! What if the JS version has this modification made, as well? In hindsight, this PR is still fine with me on a fork I made to https://github.com/tony/oembed-component. The changes to output to The ref for the template I used is at https://github.com/tony/lit-element-starter-ts/tree/tony (I also updated the packages) |
HI @tony, thanks for your review. I've updated the PR. |
Is this going to be merged at any point? The way it currently works (without a dedicated output folder for build) is unfamiliar and unhelpful. It requires a lot of undocumented configuration changes in various places just to add a new custom element or rename the built-in |
Fix lit/lit#2617