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

Fix style-spec build #6575

Merged
merged 1 commit into from
Apr 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/rollup_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const plugins = () => [

// Using this instead of rollup-plugin-flow due to
// https://github.com/leebyron/rollup-plugin-flow/issues/5
function flow() {
export function flow() {
return {
name: 'flow-remove-types',
transform: (code) => ({
Expand Down
8 changes: 3 additions & 5 deletions src/style-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"main": "./dist/index.js",
"scripts": {
"copy-flow-typed": "cp -R ../../flow-typed .",
"build": "rollup -c",
"prepublish": "in-publish && yarn copy-flow-typed && yarn build || not-in-publish",
"postpublish": "in-publish && rm -r flow-typed dist/index.js || not-in-publish"
"build": "../../node_modules/.bin/rollup -c",
"prepublish": "yarn copy-flow-typed && yarn build",
"postpublish": "rm -r flow-typed dist/index.js"
},
"repository": {
"type": "git",
Expand All @@ -29,9 +29,7 @@
"dependencies": {
"@mapbox/jsonlint-lines-primitives": "~2.0.1",
"@mapbox/unitbezier": "^0.0.0",
"brfs": "^1.4.0",
"csscolorparser": "~1.0.2",
"in-publish": "^2.0.0",
"minimist": "0.0.8",
"rw": "^1.3.3",
"sort-object": "^0.3.2"
Expand Down
21 changes: 18 additions & 3 deletions src/style-spec/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import replace from 'rollup-plugin-replace';
import {plugins} from '../../build/rollup_plugins';
import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import unassert from 'rollup-plugin-unassert';
import json from 'rollup-plugin-json';
import {flow} from '../../build/rollup_plugins';

const config = [{
input: `${__dirname}/style-spec.js`,
output: {
Expand All @@ -16,7 +22,16 @@ const config = [{
values: {
'_token_stack:': ''
}
})
].concat(plugins())
}),
flow(),
json(),
buble({transforms: {dangerousForOf: true}, objectAssign: "Object.assign"}),
unassert(),
resolve({
browser: true,
preferBuiltins: false
}),
commonjs()
]
}];
export default config;