Skip to content

Commit

Permalink
Build js style file. Fixes #83
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed May 29, 2018
1 parent b8867fc commit 48833e9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.rpt2_cache
src/style.ts
5 changes: 5 additions & 0 deletions build-style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

style=$(cat vega-embed.css)

printf "// generated with build-style.sh\nexport default \`${style}\`" > src/style.ts
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@
},
"scripts": {
"build": "rollup -c",
"clean": "rm -rf build && mkdir build",
"clean": "rm -rf build && rm -f src/style.ts && mkdir build",
"format": "tslint -p . --fix && prettier --write '{src,test}/**/*.ts'",
"lint": "tslint -p . && prettier --list-different '{src,test}/**/*.ts'",
"postbuild": "uglifyjs build/vega-embed.js -cm > build/vega-embed.min.js",
"prebuild": "npm run clean && tsc",
"prebuild": "npm run clean && ./build-style.sh && tsc",
"prepublishOnly": "npm run build",
"preversion": "npm run lint && npm run test",
"serve": "browser-sync start --directory -s -f build *.html",
"start": "npm run build && concurrently --kill-others -n Server,Typescript,Rollup 'npm run serve' 'tsc -w' 'rollup -c -w'",
"pretest": "./build-style.sh",
"test": "jest",
"test:inspect": "node --inspect-brk ./node_modules/.bin/jest --runInBand",
"watch:test": "jest --watch"
"test:inspect": "node --inspect-brk ./node_modules/.bin/jest --runInBand"
},
"jest": {
"setupFiles": [
Expand Down
2 changes: 1 addition & 1 deletion src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Config as VlConfig, TopLevelSpec as VlSpec } from 'vega-lite';
import schemaParser from 'vega-schema-url-parser';
import * as themes from 'vega-themes';
import { Handler, Options as TooltipOptions } from 'vega-tooltip';
import embedStyle from '../vega-embed.css';
import { post } from './post';
import embedStyle from './style';
import { mergeDeep } from './util';

// https://github.com/rollup/rollup/issues/670
Expand Down
4 changes: 0 additions & 4 deletions typings/css.d.ts

This file was deleted.

0 comments on commit 48833e9

Please sign in to comment.