项目作者: ray5cc

项目描述 :
The rollup plugin compile scss to css which required by your JavaScript, and copy the assets required by scss/css file to your target folder.
高级语言: TypeScript
项目地址: git://github.com/ray5cc/rollup-plugin-multi-scss.git
创建时间: 2020-06-09T13:28:33Z
项目社区:https://github.com/ray5cc/rollup-plugin-multi-scss

开源协议:MIT License

下载


" class="reference-link">rollup-plugin-multi-scss build

The rollup plugin compile scss to css which required by your JavaScript, and copy the assets required by scss/css file to your target folder.

Installation

  1. $ npm install --save-dev rollup-plugin-multi-scss

Or

  1. $ yarn add --dev rollup-plugin-multi-scss

Usage

  1. import scss from 'rollup-plugin-multi-scss';
  2. export default {
  3. input: ['./src/input/index.js', './src/input2/index.js'],
  4. output: {
  5. dir: './dist/',
  6. format: 'esm',
  7. sourcemap: true
  8. },
  9. // If preserveModules were false, the bundled css file share the same name with bundled js file
  10. preserveModules: true,
  11. plugins: [
  12. scss(),
  13. ]
  14. }

Options (all optional)

  • include SCSS/CSS file you want to include, like [‘//*.css’, ‘//.scss’], if you pass this option, the default list will be over write. default to `[‘/**/.css’, ‘/*/.scss’]`.
  • exclude Files you want to exclude, like [‘src/useless/useless.scss’]. default to [].
    -includePaths SCSS bundling include path, which is used to find required scss files. default to ['node_modules'] and current cwd.
  • output Output path. default to same as js output;
  • assetsPath Assets storage folder. default to 'img'.
  • prefix Prefix content which need add to each scss file. default to empty.
  • processor Custom processor function. default to undefined.
  • keepName Keep assets name with hash. default to true