Skip to content

Commit

Permalink
Fix extension issue on Node
Browse files Browse the repository at this point in the history
  • Loading branch information
niedzielski committed Mar 2, 2024
1 parent ee3e610 commit 2a5b076
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@
"url": "git+https://github.com/reddit/play.git"
},
"scripts": {
"build": "tools/build && tsc --build",
"build": "tools/build.js && tsc --build",
"clean": "rm -rf dist src/bundler/tsd.json",
"format": "npm run formatter -- --write",
"formatter": "prettier --cache --log-level warn './**/*.{css,html,js,json,md,ts,yaml}'",
"preversion": "[ -z \"$(git status -z)\" ]",
"prepublishOnly": "! git symbolic-ref --quiet HEAD || git push --follow-tags origin \"$(git branch --show-current)\"",
"start": "tools/build --watch",
"start": "tools/build.js --watch",
"test:format": "npm run formatter -- --check",
"test:size": "filesize",
"test:types:ui": "lit-analyzer --maxWarnings=0 --rules.no-invalid-css=off --rules.no-missing-element-type-definition --rules.no-unknown-event --rules.no-unknown-attribute=false --strict",
Expand Down
1 change: 1 addition & 0 deletions tools/build → tools/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const opts = {
sourcemap: 'linked',
target: 'es2022' // https://esbuild.github.io/content-types/#tsconfig-json
}
/** @type {esbuild.BuildOptions} */
const appOpts = {
...opts,
entryPoints: [srcFilename],
Expand Down
2 changes: 1 addition & 1 deletion tools/esbuild-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* uses `loader` whereas @web/dev-server-esbuild uses `loaders`.
* @arg {string} playVersion
* @arg {string} devvitVersion
* @ret {import('esbuild').BuildOptions}
* @return {import('esbuild').BuildOptions}
*/
export function esbuildConfig(playVersion, devvitVersion) {
return {
Expand Down
3 changes: 2 additions & 1 deletion tools/web-test-runner.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {esbuildPlugin} from '@web/dev-server-esbuild'
import {esbuildConfig} from './esbuild-config.js'

/** @type {any} */
const base = esbuildConfig('0.0.0', '0.0.1-next-2000-01-01-abcdef123.4')

/** @type {import('@web/test-runner').TestRunnerConfig} */
Expand All @@ -9,7 +10,7 @@ const config = {
nodeResolve: true,
plugins: [
esbuildPlugin({
...base,
define: base.define,
loaders: /** @type {{[ext: string]: import('esbuild').Loader}} */ (
base.loader
),
Expand Down

0 comments on commit 2a5b076

Please sign in to comment.