Giter Site home page Giter Site logo

Comments (9)

trkoch avatar trkoch commented on July 26, 2024 1

Seems like npm config settings take precedence no matter what the environment. I guess what we need here is a ionic_rollup_prod config property.

from ionic-app-scripts.

trkoch avatar trkoch commented on July 26, 2024

I'm also looking for a way to do this. Maybe related, I noticed that providing a custom rollup.config.js breaks npm run build and therefore ionic build.

from ionic-app-scripts.

fifafu avatar fifafu commented on July 26, 2024

providing a custom rollup.config.js works fine for me, how does yours look like?

from ionic-app-scripts.

trkoch avatar trkoch commented on July 26, 2024

What I meant is that if you provide a rollup.config.js this works for development, but breaks production.

from ionic-app-scripts.

fifafu avatar fifafu commented on July 26, 2024

Ah yes, because it can't find the correct file in the .tmp folder. That is why I'm looking for a way to provide the config.prod.config.js file (all it does is changing the entry file name)

from ionic-app-scripts.

trkoch avatar trkoch commented on July 26, 2024

One workaround is to append the --rollup parameter to ionic-app-scripts build. In your package.json replace "build": "ionic-app-scripts build with "build": "ionic-app-scripts build -r ./config/rollup.prod.config.js" (obviously adjusting paths to your preferences)

from ionic-app-scripts.

fifafu avatar fifafu commented on July 26, 2024

or alternatively make the rollup.config.js export a function that takes the build mode as parameter. Then we'd only need one file to handle dev and prod.

from ionic-app-scripts.

jgw96 avatar jgw96 commented on July 26, 2024

Hello all! I am taking a look at this as we speak. Thanks for all the feedback!

from ionic-app-scripts.

adamdbradley avatar adamdbradley commented on July 26, 2024

Thinking we can use the --environment flag here: https://github.com/rollup/rollup/wiki/Command-Line-Interface#examples

Then only have one config which could have if statements in it. Thoughts?

from ionic-app-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.