Skip to content

Instantly share code, notes, and snippets.

@xymostech
Last active March 8, 2017 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xymostech/e01d41c09397b8e4cf4c6b116cc9c9be to your computer and use it in GitHub Desktop.
Save xymostech/e01d41c09397b8e4cf4c6b116cc9c9be to your computer and use it in GitHub Desktop.
diff --git a/package.json b/package.json
index b3f321a..852132a 100644
--- a/package.json
+++ b/package.json
@@ -15,9 +15,10 @@
"coverage": "nyc --check-coverage --lines 100 --branches 100 npm run tests",
"tests": "mocha --compilers js:babel/register tests",
"tests:watch": "mocha --watch --compilers js:babel/register tests",
- "prebuild": "rimraf dist lib",
+ "prebuild": "rimraf dist/* lib/*",
"build": "npm-run-all --parallel build:*",
"watch:build": "npm-run-all --parallel watch:build:*",
+ "build:prefixes": "tools/generate_prefixer_data.js",
"build:main": "babel -d lib/ src",
"watch:build:main": "npm run build:main -- --watch",
"build:umd": "webpack --output-library-target umd --output-library aphrodite --output-filename aphrodite.umd.js --devtool source-map",
diff --git a/src/generate.js b/src/generate.js
index 28df4e0..b7fe164 100644
--- a/src/generate.js
+++ b/src/generate.js
@@ -1,5 +1,6 @@
/* @flow */
-import prefixAll from 'inline-style-prefixer/static';
+import createPrefixer from 'inline-style-prefixer/static/createPrefixer';
+import staticData from '../lib/staticPrefixData';
import OrderedElements from './ordered-elements';
import {
@@ -7,6 +8,8 @@ import {
importantify, flatten
} from './util';
+const prefixAll = createPrefixer(staticData);
+
/* ::
import type { SheetDefinition } from './index.js';
type StringHandlers = { [id:string]: Function };
diff --git a/tools/generate_prefixer_data.js b/tools/generate_prefixer_data.js
new file mode 100755
index 0000000..6448576
--- /dev/null
+++ b/tools/generate_prefixer_data.js
@@ -0,0 +1,22 @@
+#!/usr/bin/env node
+const generateData = require("inline-style-prefixer/generator");
+
+// We want all of the browser prefixes available, so set the browser version
+// to support to 0.
+const browserList = {
+ chrome: 0,
+ android: 0,
+ firefox: 0,
+ ios_saf: 0,
+ safari: 0,
+ ie: 0,
+ ie_mob: 0,
+ edge: 0,
+ opera: 0,
+ op_mini: 0,
+ and_uc: 0,
+ and_chr: 0,
+};
+
+generateData(browserList, {
+ staticPath: `${__dirname}/../lib/staticPrefixData.js`,
+ compatibility: true,
+});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment