Socket
Socket
Sign inDemoInstall

rollup-plugin-css-bundle

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-css-bundle - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

25

dist/index.js

@@ -5,5 +5,5 @@ 'use strict';

var rollupPluginutils = require('rollup-pluginutils');
require('postcss');
var fs = _interopDefault(require('fs'));
var fs = _interopDefault(require('fs-extra'));
var path = _interopDefault(require('path'));
var utils = _interopDefault(require('rollup-pluginutils'));

@@ -16,6 +16,7 @@ var index = (opts) => {

const options = Object.assign({
include: ['**/*.css']
include: ['**/*.css'],
transform: code => code
}, opts);
const filter = rollupPluginutils.createFilter(options.include, options.exclude);
const filter = utils.createFilter(options.include, options.exclude);

@@ -30,5 +31,5 @@ return {

transform(code, id) {
async transform(code, id) {
if (!filter(id)) return;
styles[id] = code;
styles[id] = await options.transform(code);
return '';

@@ -46,4 +47,10 @@ },

onwrite(opts) {
let dest = options.file || opts.file.replace(/\.js$/, '.css');
fs.writeFile(dest, bundles[opts.file]);
fs.outputFile(
options.output ||
path.join(
path.dirname(opts.file),
path.basename(opts.file, path.extname(opts.file)) + '.css'
),
bundles[opts.file]
);
}

@@ -50,0 +57,0 @@ }

{
"dependencies": {
"postcss": "^6.0.21",
"fs-extra": "^5.0.0",
"rollup-pluginutils": "^2.0.1"
},
"name": "rollup-plugin-css-bundle",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/index.js",

@@ -21,5 +21,5 @@ "module": "src/index.js",

"scripts": {
"build": "rollup -i src/index.js -o dist/index.js -f cjs",
"watch": "rollup -w -i src/index.js -o dist/index.js -f cjs"
"build": "rollup -c",
"watch": "rollup -w -c"
}
}

@@ -1,4 +0,4 @@

import { createFilter } from 'rollup-pluginutils';
import postcss from 'postcss';
import fs from 'fs';
import fs from 'fs-extra';
import path from 'path';
import utils from 'rollup-pluginutils';

@@ -11,6 +11,7 @@ export default (opts) => {

const options = Object.assign({
include: ['**/*.css']
include: ['**/*.css'],
transform: code => code
}, opts);
const filter = createFilter(options.include, options.exclude);
const filter = utils.createFilter(options.include, options.exclude);

@@ -25,5 +26,5 @@ return {

transform(code, id) {
async transform(code, id) {
if (!filter(id)) return;
styles[id] = code;
styles[id] = await options.transform(code);
return '';

@@ -41,6 +42,12 @@ },

onwrite(opts) {
let dest = options.file || opts.file.replace(/\.js$/, '.css');
fs.writeFile(dest, bundles[opts.file]);
fs.outputFile(
options.output ||
path.join(
path.dirname(opts.file),
path.basename(opts.file, path.extname(opts.file)) + '.css'
),
bundles[opts.file]
);
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc