Skip to content
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
1 change: 1 addition & 0 deletions insert.js
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
module.exports = require('insert-css')
6 changes: 1 addition & 5 deletions package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,7 @@
],
"dependencies": {
"falafel": "^1.2.0",
"insert-css": "^1.0.0",
"insert-css": "^2.0.0",
"map-limit": "0.0.1",
"postcss": "^5.0.10",
"postcss-prefix": "^2.0.0",
Expand All@@ -33,9 +33,6 @@
"through2": "^2.0.0",
"xtend": "^4.0.1"
},
"peerDependencies": {
"insert-css": "^1.0.0"
},
"devDependencies": {
"browserify": "^13.0.0",
"codecov.io": "^0.1.6",
Expand All@@ -45,7 +42,6 @@
"css-wipe": "^4.2.2",
"dependency-check": "^2.5.1",
"from2-string": "^1.1.0",
"insert-css": "^1.0.0",
"istanbul": "^0.4.5",
"jsdom": "^9.4.2",
"npm-check-updates": "^2.2.0",
Expand Down
8 changes: 8 additions & 0 deletions test/import.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
const browserify = require('browserify')
const concat = require('concat-stream')
const through = require('through2')
const test = require('tape')
const path = require('path')
const fs = require('fs')
Expand All@@ -22,6 +23,13 @@ test('npm import', function (t) {
const bpath = path.join(__dirname, 'fixtures/import-source.js')
browserify(bpath, bOpts)
.transform(sheetify)
.transform(function (file) {
return through(function (buf, enc, next) {
const str = buf.toString('utf8')
this.push(str.replace(/sheetify\/insert/, 'insert-css'))
next()
})
})
.plugin('css-extract', { out: outFn })
.bundle()

Expand Down
8 changes: 8 additions & 0 deletions test/plugins.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
const browserify = require('browserify')
const concat = require('concat-stream')
const through = require('through2')
const test = require('tape')
const path = require('path')
const fs = require('fs')
Expand All@@ -24,6 +25,13 @@ test('plugins', function (t) {
.transform(sheetify, {
use: [ [ 'sheetify-cssnext', { sourcemap: false } ] ]
})
.transform(function (file) {
return through(function (buf, enc, next) {
const str = buf.toString('utf8')
this.push(str.replace(/sheetify\/insert/, 'insert-css'))
next()
})
})
.plugin('css-extract', { out: outFn })
.bundle()

Expand Down
15 changes: 15 additions & 0 deletions test/prefix.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
const browserify = require('browserify')
const concat = require('concat-stream')
const through = require('through2')
const test = require('tape')
const path = require('path')
const fs = require('fs')
Expand DownExpand Up@@ -48,6 +49,13 @@ test('prefix', function (t) {
const bpath = path.join(__dirname, 'fixtures/prefix-inline-source.js')
browserify(bpath, bOpts)
.transform(transform)
.transform(function (file) {
return through(function (buf, enc, next) {
const str = buf.toString('utf8')
this.push(str.replace(/sheetify\/insert/, 'insert-css'))
next()
})
})
.plugin('css-extract', { out: outFn })
.bundle(parseBundle)

Expand DownExpand Up@@ -81,6 +89,13 @@ test('prefix', function (t) {
const bpath = path.join(__dirname, 'fixtures/prefix-import-source.js')
browserify(bpath, bOpts)
.transform(transform)
.transform(function (file) {
return through(function (buf, enc, next) {
const str = buf.toString('utf8')
this.push(str.replace(/sheetify\/insert/, 'insert-css'))
next()
})
})
.plugin('css-extract', { out: outFn })
.bundle(parseBundle)

Expand Down
2 changes: 1 addition & 1 deletion transform.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,7 +145,7 @@ function transform (filename, options) {
sheetify(val.css, val.filename, val.opts, function (err, css, prefix) {
if (err) return done(err)
const str = [
"((require('insert-css')(" + JSON.stringify(css) + ')',
"((require('sheetify/insert')(" + JSON.stringify(css) + ')',
' || true) && ' + JSON.stringify(prefix) + ')'
].join('')

Expand Down