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

DEV environment is not properly set #882

Open
3n9 opened this issue Mar 11, 2024 · 1 comment
Open

DEV environment is not properly set #882

3n9 opened this issue Mar 11, 2024 · 1 comment
Assignees
Labels
on hold Not working on it

Comments

@3n9
Copy link

3n9 commented Mar 11, 2024

Expected Behavior

  1. To have process.env.NODE_ENV set to development.
  2. To have dev variable set in webextension-toolbox-config.js

Current Behavior

  1. process.env.NODE_ENV is always set to production
  2. dev variable in webextension-toolbox-config.js is always undefined

Steps to Reproduce (for bugs)

  1. clone https://github.com/webextension-toolbox/js-extension-template
  2. run npm install
  3. add console.log(process.env.NODE_ENV); to the bottom of app/background.js
  4. create webextension-toolbox-config.js with the following contents:
module.exports = {
  webpack: (config, { dev, vendor }) => {
    // Perform customizations to webpack config
    console.log("dev: ", dev);

    // Important: return the modified config
    return config;
  },
};
  1. update package.json run script webextension-toolbox dev --config webextension-toolbox.config.js

Context

  1. When running npm run dev chrome script provides following output:
Using Babel loader to compile
dev:  undefined
  1. After dev build step, last lines of dist/chrome/background.js looks like this:
console.log("production");
}();
/******/ })()
;
@tm1000 tm1000 self-assigned this Mar 12, 2024
Copy link

stale bot commented May 12, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label May 12, 2024
@tm1000 tm1000 added wontfix This will not be worked on on hold Not working on it and removed wontfix This will not be worked on labels May 14, 2024
@stale stale bot removed the wontfix This will not be worked on label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Not working on it
Projects
None yet
Development

No branches or pull requests

2 participants