Skip to content

Commit d07bbb7

Browse files
authored
Remove unminified production build (#1111)
1 parent 30612da commit d07bbb7

11 files changed

Lines changed: 16 additions & 22 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
architecture: x64
1919
- run: npm ci
2020
- run: npm run generate-typings
21-
- run: npm run build-prod-min
2221
- run: npm run build-prod
2322
- run: npm run build-csp
2423
- run: npm run build-dev

.github/workflows/publish-style-spec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Build GL JS
2626
run: |
27-
npm run build-prod-min
27+
npm run build-prod
2828
npm run build-css
2929
3030
- name: Build style spec

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
4949
- name: Build
5050
run: |
51-
npm run build-prod-min
5251
npm run build-prod
5352
npm run build-csp
5453
npm run build-dev

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ A standalone build allows you to turn the contents of this repository into `mapl
107107

108108
To create a standalone build, run
109109
```bash
110-
npm run build-prod-min
110+
npm run build-prod
111111
npm run build-css
112112
```
113113

build/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The bundeling process can be split into several steps:
88
`npm run build-css`
99
This command will compile the css code and create the css file.
1010

11-
`npm run build-prod` or `npm run build-prod-min` or `npm run build-dev`
11+
`npm run build-prod` and `npm run build-dev`
1212
These commands will use rollup to bundle the code. This is where the magic happens and uses some files in this folder.
1313

1414
`banner.ts` is used to create a banner at the beginning of the output file

build/rollup_plugins.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const nodeResolve = resolve({
1717
preferBuiltins: false
1818
});
1919

20-
export const plugins = (minified: boolean, production: boolean): Plugin[] => [
20+
export const plugins = (production: boolean): Plugin[] => [
2121
minifyStyleSpec(),
2222
json(),
2323
// https://github.com/zaach/jison/issues/351
@@ -29,20 +29,20 @@ export const plugins = (minified: boolean, production: boolean): Plugin[] => [
2929
'_token_stack:': ''
3030
}
3131
}),
32-
production ? strip({
32+
production && strip({
3333
sourceMap: true,
3434
functions: ['PerformanceUtils.*', 'Debug.*']
35-
}) : false,
36-
minified ? terser({
35+
}),
36+
production && terser({
3737
compress: {
3838
// eslint-disable-next-line camelcase
3939
pure_getters: true,
4040
passes: 3
4141
}
42-
}) : false,
43-
production ? unassert({
42+
}),
43+
production && unassert({
4444
include: ['**/*'], // by default, unassert only includes .js files
45-
}) : false,
45+
}),
4646
nodeResolve,
4747
typescript(),
4848
commonjs({

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
"build-dev": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev",
143143
"watch-dev": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --watch",
144144
"build-prod": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:production",
145-
"build-prod-min": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:production,MINIFY:true",
146145
"build-csp": "rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts",
147146
"build-css": "postcss -o dist/maplibre-gl.css src/css/maplibre-gl.css",
148147
"build-style-spec": "rollup --configPlugin @rollup/plugin-typescript -c rollup.config.style-spec.ts && rollup --configPlugin @rollup/plugin-typescript -c rollup.config.style-spec.ts --environment esm",

rollup.config.csp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const config = (input: InputOption, file: string, format: ModuleFormat): RollupO
1616
banner
1717
},
1818
treeshake: true,
19-
plugins: plugins(true, true)
19+
plugins: plugins(true)
2020
});
2121

2222
export default [

rollup.config.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ import {plugins} from './build/rollup_plugins';
44
import banner from './build/banner';
55
import {RollupOptions} from 'rollup';
66

7-
const {BUILD, MINIFY} = process.env;
8-
const minified = MINIFY === 'true';
7+
const {BUILD} = process.env;
98
const production = BUILD === 'production';
10-
const outputFile =
11-
!production ? 'dist/maplibre-gl-dev.js' :
12-
minified ? 'dist/maplibre-gl.js' : 'dist/maplibre-gl-unminified.js';
9+
const outputFile = production ? 'dist/maplibre-gl.js' : 'dist/maplibre-gl-dev.js';
1310

1411
const config: RollupOptions[] = [{
1512
// Before rollup you should run build-tsc to transpile from typescript to javascript (except when running rollup in watch mode)
@@ -28,7 +25,7 @@ const config: RollupOptions[] = [{
2825
chunkFileNames: 'shared.js'
2926
},
3027
treeshake: production,
31-
plugins: plugins(minified, production)
28+
plugins: plugins(production)
3229
}, {
3330
// Next, bundle together the three "chunks" produced in the previous pass
3431
// into a single, final bundle. See rollup/bundle_prelude.js and

test/bench/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ By default, the style benchmark page will run its benchmarks against `https://ap
3131

3232
## Generating gl statistics
3333

34-
Build minimized production maplibre-gl-js with `npm run build-prod-min`.
34+
Build minimized production maplibre-gl-js with `npm run build-prod`.
3535

3636
Gather and output gl statistics from headless chromium with `npm run gl-stats`. The results are output to the terminal and saved in data.json.gz.
3737

0 commit comments

Comments
 (0)