Skip to content

Commit

Permalink
One weird JSON.parse() trick (#11098)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arindam Bose authored Oct 8, 2021
1 parent dc2e33e commit b29da33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/rollup_plugin_minify_style_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function minifyStyleSpec() {
delete spec['expression_name'];

return {
code: JSON.stringify(spec, replacer, 0),
code: `export default JSON.parse('${JSON.stringify(spec, replacer, 0)}');`,
map: {mappings: ''}
};
}
Expand Down
4 changes: 3 additions & 1 deletion build/rollup_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import replace from '@rollup/plugin-replace';
export const plugins = (minified, production, test, bench) => [
flow(),
minifyStyleSpec(),
json(),
json({
exclude: 'src/style-spec/reference/v8.json'
}),
production ? strip({
sourceMap: true,
functions: ['PerformanceUtils.*', 'WorkerPerformanceUtils.*', 'Debug.*']
Expand Down

0 comments on commit b29da33

Please sign in to comment.