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

How to ionic serve --prod? #26

Open
Dercetech opened this issue Mar 22, 2018 · 2 comments
Open

How to ionic serve --prod? #26

Dercetech opened this issue Mar 22, 2018 · 2 comments

Comments

@Dercetech
Copy link

Hi!

As the title says,, I'm trying to serve my environment locally with the prod settings; Doesn't work out of the box. After following the instructions on your root .md file, I've done this:

package.json
Add an npm run script:

 "serve:prod:win": "set MY_ENV=prod && ionic-app-scripts serve"

config/webpack.config.js
Update:

var env = process.env.MY_ENV;

// Set default environment to "dev"
env = env.trim();
console.log('>>>> chosen environment: "' + env + '"');

Doesn't seem quite right, even though the variable "prod" is shown to be properly selected via the console.log as I npm run serve:prod:win, it's still the dev file that's in use.

N.B. I don't quite understand webpack, so don't consider this an educated guess :-)

How would you approach this?

@M00ker
Copy link

M00ker commented Apr 9, 2018

I'd like to know how to do this too? Thanks

@writer0713
Copy link

@M00ker
I've done this too.
You can see my repo.

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

3 participants