Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-bundle-scss

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-bundle-scss - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

10

dist/index.js

@@ -10,3 +10,3 @@ 'use strict';

function bundleScss({ output } = {}) {
function bundleScss({ output, exclusive = true } = {}) {
const files = [];

@@ -18,3 +18,5 @@ return {

files.push({ id, content: source });
return { code: `export default ${JSON.stringify(source)}` };
if (exclusive) {
return { code: `export default ${JSON.stringify(source)}` };
}
}

@@ -36,4 +38,4 @@ if (/\.vue$/.test(id)) {

const outputPath = path.resolve(
path.dirname(opts.file),
output || `${path.parse(opts.file).name}.scss`,
opts.file ? path.dirname(opts.file) : opts.dir,
output || `${opts.file ? path.parse(opts.file).name : 'index'}.scss`,
);

@@ -40,0 +42,0 @@ await fs.promises.mkdir(path.dirname(outputPath), { recursive: true });

@@ -6,3 +6,3 @@ import { promises as fs } from 'fs';

export default function bundleScss({ output } = {}) {
export default function bundleScss({ output, exclusive = true } = {}) {
const files = [];

@@ -14,3 +14,5 @@ return {

files.push({ id, content: source });
return { code: `export default ${JSON.stringify(source)}` };
if (exclusive) {
return { code: `export default ${JSON.stringify(source)}` };
}
}

@@ -32,4 +34,4 @@ if (/\.vue$/.test(id)) {

const outputPath = path.resolve(
path.dirname(opts.file),
output || `${path.parse(opts.file).name}.scss`,
opts.file ? path.dirname(opts.file) : opts.dir,
output || `${opts.file ? path.parse(opts.file).name : 'index'}.scss`,
);

@@ -36,0 +38,0 @@ await fs.mkdir(path.dirname(outputPath), { recursive: true });

19

package.json
{
"name": "rollup-plugin-bundle-scss",
"version": "0.1.0",
"version": "0.1.1",
"description": "Rollup .scss imports into one bundled .scss file",

@@ -39,14 +39,15 @@ "main": "dist/index.js",

"dependencies": {
"scss-bundle": "^3.0.2",
"vue-template-compiler": "^2.6.10"
"scss-bundle": "^3.1.2",
"vue-template-compiler": "^2.6.11"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"jest": "^24.9.0",
"rollup": "^1.27.0",
"eslint": "^7.3.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.21.2",
"jest": "^26.1.0",
"rollup": "^2.18.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-vue": "^5.1.2"
"rollup-plugin-postcss": "^3.1.2",
"rollup-plugin-vue": "^5.1.9"
}
}

@@ -12,2 +12,4 @@ # rollup-plugin-bundle-scss

It dependence on [scss-bundle](https://github.com/reactway/scss-bundle).
## Installation

@@ -61,1 +63,37 @@

```
Using with [rollup-plugin-postcss](https://github.com/egoist/rollup-plugin-postcss):
```js
import bundleScss from 'rollup-plugin-bundle-scss';
import postcss from 'rollup-plugin-postcss';
export default {
input: 'src/index.js',
output: {
file: 'dist/index.js',
format: 'esm',
},
plugins: [
// put it before postcss(), and set exclusive to false
bundleScss({ exclusive: false }),
postcss({
// ...
}),
],
};
```
## API
```js
bundleScss({
// where to output bundled SCSS file
output: String,
// Whether SCSS file is exclusive to rollup-plugin-bundle-scss.
// Defalut value: true
// Set it to false when there're other plugin to handle SCSS file after bundleScss()
exclusive: Boolean,
})
```
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