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

Add basic production build script #118

Merged
merged 2 commits into from
Feb 26, 2017
Merged

Conversation

cookpete
Copy link

@cookpete cookpete commented Feb 21, 2017

There are a bunch of dead issues (#63, #90, #13, #48) and a dead PR (#81) for production builds so I thought I would put forward my effort. I tried to make it as simple and non-intrusive as possible, but rimraf, cross-env and copyfiles are required for the build to work across other environments (ie Windows).

The only weirdness is having to use static/bundle.js as the output.filename to ensure that bundle.js gets put into the /dist/static folder. This is so the reference to the bundle in index.html remains correct and we can simply copy the file into dist. Alternatively we could use html-webpack-plugin but it seems rather heavy for what should be a simple boilerplate.

The production config is essentially a copy of the development config but with:

  • Less code comments (to avoid too much repetition)
  • devtool: 'source-map'
  • Just the one src/index.js entry file
  • UglifyJsPlugin for minification instead of all the dev plugins

@calesce
Copy link
Collaborator

calesce commented Feb 26, 2017

@cookpete Thanks, this looks great!

@calesce calesce merged commit 530fb8f into gaearon:next Feb 26, 2017
@calesce calesce mentioned this pull request Feb 26, 2017
@cookpete cookpete deleted the build-script branch February 20, 2018 10:36
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.

None yet

2 participants