-
-
Notifications
You must be signed in to change notification settings - Fork 113
Fix output path not working for production builds #102
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I have to use dynamic import to import css?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During development we inject the styles into the page via <style> tag which is why it works via ESM imports but in production we generate the CSS file via MiniCssExtractPlugin and link via an appended tag. I'll see what I can do.
da8da95
to
1a1e302
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. I have no further questions ~
I made some changes to the
main
branch and now thestart
command is now a combination of thebuild
+preview
commands, so runningyarn start <extension-path>
should reflect the extension in a production environment.To test this PR, ensure that:
yarn start <extension-path>
for the React template builds the extension and loads the browser in production.yarn start <extension-path>
for the Vue.js template builds the extension and loads the browser in production.--browser=edge
or--browser=firefox --polyfill
manifest_version
is set to2
and usesbackground.scripts
instead ofbackground.service_worker
. For some reason I couldn't make it work using V3.background.service_worker
caches while switching between betweendev
/start
commands, so good to test toggling between these environments to assert the extension reloads as usual.Tough one!
React-TypeScript template (production mode)
Vue-TypeScript template (production mode)
Fix #95
Fix #96