-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 an unminified production build to the NPM package #7403
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,12 @@ import sourcemaps from 'rollup-plugin-sourcemaps'; | |
import {plugins} from './build/rollup_plugins'; | ||
|
||
const version = JSON.parse(fs.readFileSync('package.json')).version; | ||
|
||
const production = process.env.BUILD === 'production'; | ||
const outputFile = production ? 'dist/mapbox-gl.js' : 'dist/mapbox-gl-dev.js'; | ||
const {BUILD} = process.env; | ||
const minified = BUILD === 'production'; | ||
const production = BUILD === 'production' || BUILD === 'production-unminified'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove the conflation of debug/release and minification? We could have two separate variables: |
||
const outputFile = | ||
minified ? 'dist/mapbox-gl.js' : | ||
production ? 'dist/mapbox-gl-unminified.js' : 'dist/mapbox-gl-dev.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still doesn't account for the matrix of const suffix = (production ? '' : '-dev') + (minified ? '' : '-unminified');
const outputFile = 'dist/mapbox-gl' + suffix + '.js'; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kkaefer I wouldn't want to change names of existing builds. This suggestion would rename There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's reverse the MINIFY flag and default to true, then specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kkaefer and rename the current There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, the suffix only gets added for unminified builds There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kkaefer so it would still be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the confusion; I didn't realize that the dev version is unminified. What I was trying to get at is that we have 4 possible combinations of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it doesn't make sense to have a minified dev build anyway, I don't think we need to worry about it. I added another commit that hopefully makes build naming logic clearer. Feel free to add any changes you feel are needed here and I'll review, and otherwise we can merge. |
||
|
||
const config = [{ | ||
// First, use code splitting to bundle GL JS into three "chunks": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why
build-alt
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a short name for the package script (which shouldn't be called directly anyway), "alternative" build. Didn't want to name it
build-production-unminified
.