Skip to content

chore(build): Switch to rollup + Update Dependencies #150

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

Merged
merged 4 commits into from
Aug 22, 2017

Conversation

AntJanus
Copy link
Collaborator

Updates all the dependencies and changes the build from webpack to
rollup exposing now multiple formats:

  • umd
  • umd minified
  • cjs
  • es

Updates all the dependencies and changes the build from webpack to
rollup exposing now multiple formats:
- umd
- umd minified
- cjs
- es
@AntJanus
Copy link
Collaborator Author

This is awesome @deini ! Let me know if there is any more work you want to do on this, if not, we can just merge it in.

@AntJanus
Copy link
Collaborator Author

Oh, I meant to ask! @deini is the yarn.lock necessary? I don't believe you're supposed to check it into libraries, just project/app repos themselves.

@deini
Copy link
Collaborator

deini commented Aug 17, 2017

@AntJanus while not necessary its a good practice, this is a good read.

I don't have any more work that I want to add at this time, I think its good to go. I tested it but if you can give it another run that would be cool too.

@AntJanus
Copy link
Collaborator Author

@deini sounds good! I trust Kyle's opinion on these matters. :)

.DS_Store
*.log
*.tgs
*.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question about this, why aren't any of these being ignored any longer?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added files in package.json which pretty much instead of having to ignore what we don't want, we explicitly add what we do want. Therefore no need to have .npmignore anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had no idea about that one! Thanks! :)

package.json Outdated
"build:umd:min": "cross-env NODE_ENV=production rollup -c -o dist/ng-redux.min.js",
"build": "yarn run build:commonjs && yarn run build:es && yarn run build:umd && yarn run build:umd:min",
"test": "NODE_ENV=test mocha --compilers js:babel-register --recursive",
"prepublish": "yarn run clean && yarn test && yarn run build"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deini why did we switch to using yarn over npm in the build process? We don't have yarn in the dependencies, and I, for example, don't have yarn on my machine because it's still screwy in some ways and not as cross-system compatible (Windows definitely suffers here).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, switched to $npm_execpath

package.json Outdated
"build:es": "cross-env NODE_ENV=es rollup -c -o es/ng-redux.js",
"build:umd": "cross-env NODE_ENV=development rollup -c -o dist/ng-redux.js",
"build:umd:min": "cross-env NODE_ENV=production rollup -c -o dist/ng-redux.min.js",
"build": "$npm_execpath run build:commonjs && $npm_execpath run build:es && $npm_execpath run build:umd && $npm_execpath run build:umd:min",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $npm_execpath fails on windows. I looked up the issue and it looks like the variable is not a standard. I couldn't find anything about it on NPM docs and the few places I checked out on Github that tried to use it either rolled back to npm or used some other method for checking the variable and falling back on npm.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you basing this in the random guy from SO? I tested it on windows /shrug.

I'm making the change just to get it merged asap but I kinda disagree.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no. I tested it and the variable does not exist at all in my environment and the command fails when I run it. I looked into a couple of repos that tried to use it and noticed that even repos that heavily support yarn, still reference NPM.

Here's the weird thing: I do have Yarn installed. So it seems that neither NPM nor Yarn add this variable by default. I did a clean install of NPM when NPM reached version 5.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to mention that I'd rather we have this kind of compatibility for our yarn and NPM users than not but it seems like depending on that variable is not reliable :(

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats interesting, but as you said, since its not actually well documented, lets just keep npm until there is a supported way of doing it, my bad.

package.json Outdated
"build:umd": "cross-env NODE_ENV=development rollup -c -o dist/ng-redux.js",
"build:umd:min": "cross-env NODE_ENV=production rollup -c -o dist/ng-redux.min.js",
"build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min",
"test": "NODE_ENV=test mocha --compilers js:babel-register --recursive",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate to do this. I tried to push up my own change but since this is coming from your fork, I can't make changes. Can you add cross-env in front of the NODE_ENV?

Also, I sent you a collab invite :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, just added it.

@AntJanus AntJanus merged commit c76d646 into angular-redux:master Aug 22, 2017
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

Successfully merging this pull request may close these issues.

2 participants