Skip to content
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

Production environment not loading js asset when using Typescript as input #1

Open
turansadri opened this issue Mar 7, 2024 · 1 comment

Comments

@turansadri
Copy link

turansadri commented Mar 7, 2024

I'm using the Press-wind starter theme and I noticed that when using TypeScript as input (changing main.js to main.ts in vite.config.js) the production does not enqueue the built js asset in front end.

I did set the is_ts option to true but the problem seems to be on PWVite.php on line 214. set_script_prod function only checks if the src in manifest.json contains .js but as the input is main.ts the src value is main.ts.

I'm not sure if this should be fixed in set_script_prod or should I be able to fix this in my vite.config.js so that it will print main.js as src in manifest.json when I'm running the build?

Here's how my manifest.json looks like after building:

{
  "main.ts": {
    "css": [
      "assets/main-tpLjbuv5.css"
    ],
    "file": "assets/main-DMYVO1Dv.js",
    "isEntry": true,
    "src": "main.ts"
  }
}
@ipatate
Copy link
Contributor

ipatate commented Jul 3, 2024

hi, i have tested with .ts file and it's work normally.
the child theme for my test https://github.com/WP-Performance/child-2024-presswind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants