├── .github └── workflows │ └── test.yaml ├── .gitignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── index.d.ts ├── package.json ├── rollup.config.mjs ├── src └── index.mjs ├── test ├── circular │ ├── a.js │ ├── b.js │ └── rollup.config.mjs ├── empty │ ├── expected.css │ ├── expected.js │ ├── input.css │ ├── input.js │ └── rollup.config.mjs ├── nested │ ├── README.md │ ├── css │ │ ├── b.css │ │ ├── g.css │ │ └── r.css │ ├── expected.css │ ├── expected.js │ ├── input.js │ ├── js │ │ └── b.js │ └── rollup.config.mjs ├── simple │ ├── expected.css │ ├── expected.js │ ├── input.css │ ├── input.js │ └── rollup.config.mjs └── unique │ ├── dependency-a.js │ ├── expected.css │ ├── expected.js │ ├── input.css │ ├── main.js │ ├── output │ ├── dependency-a.js │ └── main.js │ └── rollup.config.mjs └── yarn.lock /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Node.js CI 2 | on: 3 | push: 4 | branches: [v3, v4] 5 | pull_request: 6 | branches: [v3, v4] 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | node-version: [18.x, 19.x] 13 | steps: 14 | - uses: actions/checkout@v3 15 | - name: Use Node.js ${{ matrix.node-version }} 16 | uses: actions/setup-node@v3 17 | with: 18 | node-version: ${{ matrix.node-version }} 19 | - run: yarn --frozen-lockfile 20 | - run: yarn build 21 | - run: yarn test 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Dependency directory 7 | node_modules 8 | 9 | # Unwanted 10 | .idea 11 | .DS_Store 12 | 13 | # Build files 14 | dist 15 | /test/**/output.* 16 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "bracketSpacing": true, 4 | "insertPragma": false, 5 | "jsxBracketSameLine": false, 6 | "printWidth": 80, 7 | "proseWrap": "preserve", 8 | "requirePragma": false, 9 | "semi": false, 10 | "singleQuote": true, 11 | "tabWidth": 2, 12 | "trailingComma": "none", 13 | "useTabs": false 14 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `rollup-plugin-css-only` will be documented in this file. 4 | 5 | ## [Unreleased] 6 | 7 | ## [4.5.2] - 2023-11-07 8 | 9 | ### Changed 10 | 11 | - Fix duplicate styles in output https://github.com/thgh/rollup-plugin-css-only/pull/58 https://github.com/thgh/rollup-plugin-css-only/issues/55 https://github.com/thgh/rollup-plugin-css-only/issues/49 12 | 13 | ## [4.4.0] - 2023-11-01 14 | 15 | ### Changed 16 | 17 | - Support Rollup v4 as peerDependencies 18 | 19 | ### Changed 20 | 21 | - Mark visited modules to avoid infinite recursion 22 | 23 | ## [4.3.0] - 2022-11-04 24 | 25 | ### Changed 26 | 27 | - Mark visited modules to avoid infinite recursion 28 | 29 | ## [4.2.0] - 2022-10-25 30 | 31 | ### Changed 32 | 33 | - Fix issue when module info is null 34 | 35 | ## [4.1.1] - 2022-10-21 36 | 37 | ### Changed 38 | 39 | - Always append newline to asset to make it's generated 40 | 41 | ## [4.1.0] - 2022-10-20 42 | 43 | ### Changed 44 | 45 | - Simplify name/fileName by making them explicit options 46 | 47 | ## [4.0.0] - 2020-12-18 48 | 49 | ### Changed 50 | 51 | - BREAKING CHANGE: CSS is emitted as 1 asset instead of written using `writeFile`. 52 | - Order of imports is guaranteed 53 | - Require @rollup/pluginutils@4 54 | 55 | ### Added 56 | 57 | - Mark as compatible with rollup 3 #45 @el3um4s 58 | 59 | ## [3.1.0] - 2020-12-18 60 | 61 | ### Changed 62 | 63 | - Require @rollup/pluginutils@4 64 | 65 | ## [3.0.0] - 2020-11-19 66 | 67 | ### Changed 68 | 69 | - Maintain import order of stylesheets when combining #21 @staydecent 70 | - Use emitFile instead of outputFile #24 @benmccann 71 | - Upgrade dependencies @thgh 72 | 73 | ## [2.1.0] - 2020-06-02 74 | 75 | ### Added 76 | 77 | - Mark as compatible with rollup 2 #14 @yagebu 78 | 79 | ### Changed 80 | 81 | - Fix file writing errors #19 @aminya 82 | - Upgrade dependencies #14 @yagebu 83 | 84 | ## [2.0.0] - 2019-12-21 85 | 86 | ### Added 87 | 88 | - Add `bundle` as 3rd argument in `output` function @lazyhero 89 | 90 | ### Changed 91 | 92 | - Replace mkdirp by fs.mkdir (Node.js 10.12+) @MichaelAllenHardeman 93 | 94 | ## [1.0.0] - 2019-01-27 95 | 96 | ### Added 97 | 98 | - Add ES modules build: `dist/index.es.js` 99 | 100 | ### Changed 101 | 102 | - Migrate to Rollup v1 @tlvince 103 | 104 | [unreleased]: https://github.com/thgh/rollup-plugin-css-only/compare/v2.0.0...HEAD 105 | [2.0.0]: https://github.com/thgh/rollup-plugin-css-only/compare/v1.0.0...v2.0.0 106 | [1.0.0]: https://github.com/thgh/rollup-plugin-css-only/compare/v0.0.1...v1.0.0 107 | [0.0.1]: https://github.com/thgh/rollup-plugin-css-only/releases 108 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Thomas Ghysels 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rollup plugin that bundles imported css 2 | 3 | 4 | Software License 5 | 6 | 7 | Issues 8 | 9 | 10 | JavaScript Style Guide 11 | 12 | 13 | NPM 14 | 15 | 16 | Latest Version 17 | 18 | 19 | ## Features 20 | 21 | - CSS is emitted as 1 asset 22 | - Order of imports is guaranteed 23 | - Watches CSS imports 24 | - Typescript types 25 | 26 | ## Installation 27 | 28 | ``` 29 | # v4 is compatible with Rollup 4 & 3 & 2 30 | # Rollup 4 since v4.4 31 | npm install --save-dev rollup-plugin-css-only 32 | ``` 33 | 34 | ## Usage 35 | 36 | ```js 37 | // rollup.config.js 38 | import css from 'rollup-plugin-css-only' 39 | 40 | export default { 41 | input: 'input.js', 42 | output: { 43 | file: 'output.js', 44 | format: 'es', 45 | assetFileNames: 'assets/[name]-[hash][extname]' 46 | }, 47 | plugins: [css()] 48 | } 49 | ``` 50 | 51 | ```js 52 | // entry.js 53 | import './reset.css' 54 | import './layout.css' 55 | ``` 56 | 57 | ```css 58 | /* layout.css */ 59 | @import './nested.css'; 60 | @import './more.css'; 61 | ``` 62 | 63 | ### Options 64 | 65 | There is 1 option: `output`. 66 | By default the plugin will use `output.assetFileNames` to decide the filename. 67 | 68 | ```js 69 | css({ 70 | // Optional: filename to write all styles to 71 | output: 'bundle.css' 72 | }) 73 | ``` 74 | 75 | ## Changelog 76 | 77 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 78 | 79 | ## Contributing 80 | 81 | Contributions and feedback are very welcome. 82 | 83 | To get it running: 84 | 85 | 1. Clone the project. 86 | 2. `npm install` 87 | 3. `npm run build` 88 | 89 | ## Credits 90 | 91 | - [Thomas Ghysels](https://github.com/thgh) 92 | - [All Contributors][link-contributors] 93 | 94 | ## License 95 | 96 | The MIT License (MIT). Please see [License File](LICENSE) for more information. 97 | 98 | [link-author]: https://github.com/thgh 99 | [link-contributors]: ../../contributors 100 | [rollup-plugin-vue]: https://www.npmjs.com/package/rollup-plugin-vue 101 | [rollup-plugin-buble]: https://www.npmjs.com/package/rollup-plugin-buble 102 | [rollup-plugin-babel]: https://www.npmjs.com/package/rollup-plugin-babel 103 | [vue-template-compiler]: https://www.npmjs.com/package/vue-template-compiler 104 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for rollup-plugin-css-only 3.1 2 | // Project: https://github.com/thgh/rollup-plugin-css-only 3 | // Definitions by: Mateusz Szewc 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 5 | 6 | /// 7 | import { Plugin, OutputBundle } from 'rollup' 8 | 9 | declare namespace css { 10 | interface Options { 11 | /** 12 | * All CSS files will be parsed by default, but you can also specifically include files 13 | */ 14 | include?: ReadonlyArray | string | RegExp | null 15 | /** 16 | * CSS files to exclude from being parsed 17 | */ 18 | exclude?: ReadonlyArray | string | RegExp | null 19 | /** 20 | * If a name is supplied, this will be used as substitution for [name] 21 | * in the corresponding output.chunkFileNames or output.assetFileNames pattern, 22 | * possibly adding a unique number to the end of the file name to avoid conflicts. 23 | * If neither a name nor fileName is supplied, a default name will be used. 24 | * 25 | * @link https://rollupjs.org/guide/en/#thisemitfile 26 | */ 27 | name?: string 28 | /** 29 | * If a fileName is provided, it will be used unmodified as the name of the generated file, 30 | * throwing an error if this causes a conflict. 31 | * If neither a name nor fileName is supplied, a default name will be used. 32 | * 33 | * @link https://rollupjs.org/guide/en/#thisemitfile 34 | */ 35 | fileName?: string 36 | /** 37 | * Callback that will be called ongenerate 38 | * 39 | * When set to a string, it will be used as `fileName`. 40 | */ 41 | output?: 42 | | boolean 43 | /** @deprecated Use name or fileName instead */ 44 | | string 45 | | (( 46 | styles: string, 47 | styleNodes: Record, 48 | bundle: OutputBundle 49 | ) => void) 50 | | null 51 | | undefined 52 | } 53 | } 54 | 55 | declare function css(options?: css.Options): Plugin 56 | export = css 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rollup-plugin-css-only", 3 | "version": "4.5.2", 4 | "description": "Rollup plugin that bundles imported css", 5 | "main": "dist/index.cjs", 6 | "module": "dist/index.mjs", 7 | "jsnext:main": "dist/index.mjs", 8 | "exports": { 9 | ".": { 10 | "import": "./dist/index.mjs", 11 | "default": "./dist/index.cjs" 12 | } 13 | }, 14 | "scripts": { 15 | "build": "rollup -c", 16 | "dev": "rollup -cw", 17 | "test:circular": "cd test/circular && rm -rf output && rollup -c && cd ../..", 18 | "test:nested": "cd test/nested && rm -rf output && rollup -c && cmp output/output.js expected.js && cmp output/output.css expected.css && cd ../..", 19 | "test:empty": "cd test/empty && rm -rf output && rollup -c && cmp output/output.js expected.js && cmp output/output.css expected.css && cd ../..", 20 | "test:simple": "cd test/simple && rm -rf output && rollup -c && cmp output/output.js expected.js && cmp output/output.css expected.css && cd ../..", 21 | "test:unique": "cd test/unique && rm -rf output && rollup -c && cmp output/main.js expected.js && cmp output/output.css expected.css && cd ../..", 22 | "test:win:simple": "cd .\\test\\simple && del -f output.* && rollup -c && cd .. && ECHO n|comp simple\\output.js expected.js && ECHO n|comp simple\\output.css simple\\expected.css && cd ..", 23 | "test": "npm run test:simple && npm run test:nested && npm run test:empty && npm run test:circular && npm run test:unique", 24 | "test:win": "npm run test:win:simple", 25 | "lint": "prettier rollup.config.js src/**", 26 | "prepare": "npm run build", 27 | "prepublish": "npm run build", 28 | "check-updates": "npx npm-check-updates", 29 | "check-updates:minor": "npx npm-check-updates --target minor", 30 | "check-updates:patch": "npx npm-check-updates --target patch" 31 | }, 32 | "keywords": [ 33 | "rollup-plugin", 34 | "css" 35 | ], 36 | "license": "MIT", 37 | "author": "Thomas Ghysels ", 38 | "homepage": "https://github.com/thgh/rollup-plugin-css-only", 39 | "bugs": { 40 | "url": "https://github.com/thgh/rollup-plugin-css-only/issues" 41 | }, 42 | "repository": { 43 | "type": "git", 44 | "url": "https://github.com/thgh/rollup-plugin-css-only" 45 | }, 46 | "files": [ 47 | "dist" 48 | ], 49 | "engines": { 50 | "node": ">=14" 51 | }, 52 | "peerDependencies": { 53 | "rollup": "<5" 54 | }, 55 | "dependencies": { 56 | "@rollup/pluginutils": "5" 57 | }, 58 | "devDependencies": { 59 | "rollup": "<5" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /rollup.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | input: 'src/index.mjs', 3 | output: [ 4 | { 5 | file: 'dist/index.cjs', 6 | format: 'cjs', 7 | exports: 'default' 8 | }, 9 | { 10 | file: 'dist/index.mjs', 11 | format: 'es' 12 | } 13 | ], 14 | external: ['@rollup/pluginutils', 'fs-extra/lib/output'], 15 | } 16 | -------------------------------------------------------------------------------- /src/index.mjs: -------------------------------------------------------------------------------- 1 | import { createFilter } from '@rollup/pluginutils' 2 | 3 | export default function css(options = {}) { 4 | const filter = createFilter(options.include || ['**/*.css'], options.exclude) 5 | const styles = {} 6 | let output = options.output 7 | let name = options.name 8 | let fileName = options.fileName 9 | 10 | // Get all CSS modules in the order that they were imported 11 | const getCSSModules = (id, getModuleInfo, modules = new Set(), visitedModules = new Set()) => { 12 | if (modules.has(id) || visitedModules.has(id)) { 13 | return new Set() 14 | } 15 | 16 | if (filter(id)) modules.add(id) 17 | 18 | // Prevent infinite recursion with circular dependencies 19 | visitedModules.add(id); 20 | 21 | // Recursively retrieve all of imported CSS modules 22 | const info = getModuleInfo(id) 23 | if (!info) return modules 24 | 25 | info.importedIds.forEach(importId => { 26 | modules = new Set( 27 | [].concat( 28 | Array.from(modules), 29 | Array.from(getCSSModules(importId, getModuleInfo, modules, visitedModules)) 30 | ) 31 | ) 32 | }) 33 | 34 | return modules 35 | } 36 | 37 | return { 38 | name: 'css', 39 | transform(code, id) { 40 | if (!filter(id)) { 41 | return 42 | } 43 | 44 | // When output is disabled, the stylesheet is exported as a string 45 | if (options.output === false) { 46 | return { 47 | code: 'export default ' + JSON.stringify(code), 48 | map: { mappings: '' } 49 | } 50 | } 51 | 52 | // Keep track of every stylesheet 53 | // Check if it changed since last render 54 | // NOTE: If we are in transform block, we can assume styles[id] !== code, right? 55 | if (styles[id] !== code && (styles[id] || code)) { 56 | styles[id] = code 57 | } 58 | 59 | return '' 60 | }, 61 | generateBundle(opts, bundle) { 62 | const ids = new Set() 63 | 64 | // Determine import order of files 65 | for (const file in bundle) { 66 | const root = bundle[file].facadeModuleId 67 | const modules = getCSSModules(root, this.getModuleInfo) 68 | modules.forEach(id => ids.add(id)) 69 | } 70 | 71 | // Combine all stylesheets, respecting import order 72 | const css = Array.from(ids).map(id => styles[id]).join('\n') 73 | 74 | // Emit styles through callback 75 | if (typeof options.output === 'function') { 76 | options.output(css, styles, bundle) 77 | return 78 | } 79 | 80 | if (typeof output == 'string') { 81 | fileName = fileName || output 82 | } 83 | 84 | // Emit styles to file 85 | this.emitFile({ type: 'asset', name, fileName, source: css + '\n' }) 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /test/circular/a.js: -------------------------------------------------------------------------------- 1 | import b from './b.js'; 2 | export default 42; 3 | -------------------------------------------------------------------------------- /test/circular/b.js: -------------------------------------------------------------------------------- 1 | import a from './a.js'; 2 | export default 42; 3 | -------------------------------------------------------------------------------- /test/circular/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import css from '../../src/index.mjs' 2 | 3 | export default { 4 | input: 'a.js', 5 | output: { 6 | file: 'output/output.js', 7 | format: 'esm' 8 | }, 9 | plugins: [css({ output: 'output.css' })] 10 | } 11 | -------------------------------------------------------------------------------- /test/empty/expected.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/empty/expected.js: -------------------------------------------------------------------------------- 1 | console.log('css imported'); 2 | -------------------------------------------------------------------------------- /test/empty/input.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thgh/rollup-plugin-css-only/c9f22c25c254ea78dcc8af97e74cc3faccf0ad14/test/empty/input.css -------------------------------------------------------------------------------- /test/empty/input.js: -------------------------------------------------------------------------------- 1 | import './input.css' 2 | 3 | console.log('css imported') 4 | -------------------------------------------------------------------------------- /test/empty/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import css from '../../src/index.mjs' 2 | 3 | export default { 4 | input: 'input.js', 5 | output: { 6 | file: 'output/output.js', 7 | format: 'esm' 8 | }, 9 | plugins: [css({ output: 'output.css' })] 10 | } 11 | -------------------------------------------------------------------------------- /test/nested/README.md: -------------------------------------------------------------------------------- 1 | ## Test Case 2 | This is to test that nested imports are bundled in the proper order -------------------------------------------------------------------------------- /test/nested/css/b.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } -------------------------------------------------------------------------------- /test/nested/css/g.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: green; 3 | } -------------------------------------------------------------------------------- /test/nested/css/r.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } -------------------------------------------------------------------------------- /test/nested/expected.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | body { 5 | background-color: red; 6 | } 7 | body { 8 | background-color: green; 9 | } 10 | -------------------------------------------------------------------------------- /test/nested/expected.js: -------------------------------------------------------------------------------- 1 | console.log('This should happen first'); 2 | 3 | console.log('This should happen second'); 4 | -------------------------------------------------------------------------------- /test/nested/input.js: -------------------------------------------------------------------------------- 1 | import './js/b.js'; 2 | import './css/r.css'; 3 | import './css/g.css'; 4 | 5 | console.log('This should happen second'); -------------------------------------------------------------------------------- /test/nested/js/b.js: -------------------------------------------------------------------------------- 1 | import '../css/b.css'; 2 | 3 | console.log('This should happen first'); -------------------------------------------------------------------------------- /test/nested/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import css from '../../src/index.mjs' 2 | 3 | export default { 4 | input: 'input.js', 5 | output: { 6 | file: 'output/output.js', 7 | format: 'esm' 8 | }, 9 | plugins: [css({ output: 'output.css' })] 10 | } 11 | -------------------------------------------------------------------------------- /test/simple/expected.css: -------------------------------------------------------------------------------- 1 | .rollup { 2 | color: green; 3 | user-select: none; 4 | } 5 | -------------------------------------------------------------------------------- /test/simple/expected.js: -------------------------------------------------------------------------------- 1 | console.log('css imported'); 2 | -------------------------------------------------------------------------------- /test/simple/input.css: -------------------------------------------------------------------------------- 1 | .rollup { 2 | color: green; 3 | user-select: none; 4 | } -------------------------------------------------------------------------------- /test/simple/input.js: -------------------------------------------------------------------------------- 1 | import './input.css' 2 | 3 | console.log('css imported') 4 | -------------------------------------------------------------------------------- /test/simple/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import css from '../../src/index.mjs' 2 | 3 | export default { 4 | input: 'input.js', 5 | output: { 6 | file: 'output/output.js', 7 | format: 'esm' 8 | }, 9 | plugins: [css({ output: 'output.css' })] 10 | } 11 | -------------------------------------------------------------------------------- /test/unique/dependency-a.js: -------------------------------------------------------------------------------- 1 | import './input.css' 2 | 3 | console.log('dependency-a'); 4 | -------------------------------------------------------------------------------- /test/unique/expected.css: -------------------------------------------------------------------------------- 1 | .rollup { 2 | color: green; 3 | user-select: none; 4 | } 5 | -------------------------------------------------------------------------------- /test/unique/expected.js: -------------------------------------------------------------------------------- 1 | import('./dependency-a.js'); 2 | -------------------------------------------------------------------------------- /test/unique/input.css: -------------------------------------------------------------------------------- 1 | .rollup { 2 | color: green; 3 | user-select: none; 4 | } -------------------------------------------------------------------------------- /test/unique/main.js: -------------------------------------------------------------------------------- 1 | import './input.css' 2 | import('./dependency-a.js') 3 | -------------------------------------------------------------------------------- /test/unique/output/dependency-a.js: -------------------------------------------------------------------------------- 1 | console.log('dependency-a'); 2 | -------------------------------------------------------------------------------- /test/unique/output/main.js: -------------------------------------------------------------------------------- 1 | import('./dependency-a.js'); 2 | -------------------------------------------------------------------------------- /test/unique/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import css from '../../src/index.mjs' 2 | 3 | export default { 4 | input: 'main.js', 5 | output: { 6 | chunkFileNames: '[name].js', 7 | dir: 'output', 8 | format: 'esm' 9 | }, 10 | plugins: [css({ output: 'output.css' })] 11 | } 12 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@rollup/pluginutils@5": 6 | version "5.0.5" 7 | resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz" 8 | integrity sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q== 9 | dependencies: 10 | "@types/estree" "^1.0.0" 11 | estree-walker "^2.0.2" 12 | picomatch "^2.3.1" 13 | 14 | "@rollup/rollup-android-arm-eabi@4.0.0": 15 | version "4.0.0" 16 | resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.0.0.tgz#3a0258d22b5ee30235d04b4b4cd49c28b590ad8e" 17 | integrity sha512-rN3qt1JzOx0v7JWyK68zkb3yf1k1f1OhhHR0i7vLlGlediTtM3FKsOkestQN6HwJ9nEaP3KxPHxH5Xv7yr6f4w== 18 | 19 | "@rollup/rollup-android-arm64@4.0.0": 20 | version "4.0.0" 21 | resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.0.0.tgz#e4fc4213a7d600f7a32ccfe0affcc2c7a799e52e" 22 | integrity sha512-dcdg6Zp2bqIS/+2FHhdSS+lbcySufP2fYYoXkDa4W6uHE22L15psftdQZtFhxvvqRWPD1HsK0xIj5f07zuujkg== 23 | 24 | "@rollup/rollup-darwin-arm64@4.0.0": 25 | version "4.0.0" 26 | resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.0.0.tgz#24a63082a59a5e482ef240441257c2a75d6e2d04" 27 | integrity sha512-mOz75DpOOHGk4+xYbh1E23vmSOrOqskTwq9s/e2Z46eYbTZ0+s/UVoS42cLG8dUe6enF2Xh3hTtiIEzLhO9kmA== 28 | 29 | "@rollup/rollup-darwin-x64@4.0.0": 30 | version "4.0.0" 31 | resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.0.0.tgz#262abe210e6c23238a8a7bd70745ff2281eef694" 32 | integrity sha512-rEBuHQ2ejl9gb0//19F88gR7Z9HY2kcCX8jT5LhCHqGqAvlloETXO1FD7DKEdqGz98UtJy6pVAxxeVBN4tlWag== 33 | 34 | "@rollup/rollup-linux-arm-gnueabihf@4.0.0": 35 | version "4.0.0" 36 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.0.0.tgz#fb6d797c78701f9e95361587ac22d58a5a896faf" 37 | integrity sha512-W4Elp0SGWqWOkdgoYniOp6ERrhHYRfMPikUZmnU/kAdLXQ9p0M0meF648Z6Y7ClHJr8pIQpcCdmr7E2h8Kn7Fw== 38 | 39 | "@rollup/rollup-linux-arm64-gnu@4.0.0": 40 | version "4.0.0" 41 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.0.0.tgz#f7d56849e33d749751a5a6608dcc72d12654c2be" 42 | integrity sha512-/BTevM/UKprMJgFse0nm+YXQ83iDqArru+k3kZtQlvaNMWdkLcyscOP8SwWPpR0CJuLlXr8Gtpps+EgH3TUqLA== 43 | 44 | "@rollup/rollup-linux-x64-gnu@4.0.0": 45 | version "4.0.0" 46 | resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.0.0.tgz" 47 | integrity sha512-Pz2FD/4FUZM98+rcpuGAJgatW5/dW/pXXrbanjtir38EYqqmdVc0odHwqlQ+KFY2C5P+B6PJO5vom8PmJQLdug== 48 | 49 | "@rollup/rollup-linux-x64-musl@4.0.0": 50 | version "4.0.0" 51 | resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.0.0.tgz" 52 | integrity sha512-Xs2tOshU5MD7nK5WnaSBUwiFdBlMtyKdXOOnBno4IRbDIyrjLtx9lnSIO47FNP0LtpGfyOcsK/lE/ZsLlnXyIg== 53 | 54 | "@rollup/rollup-win32-arm64-msvc@4.0.0": 55 | version "4.0.0" 56 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.0.0.tgz#98cab6ea9398adbe07573acc22a69661f1b22a67" 57 | integrity sha512-h2r04SsqVMbmaIRSMN3HKQLYpKewJ7rWQx1SwEZQMeXRkecWFBBNOfoB3iMlvvUfc3VUOonR/3Dm/Op6yOD2Lg== 58 | 59 | "@rollup/rollup-win32-ia32-msvc@4.0.0": 60 | version "4.0.0" 61 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.0.0.tgz#93f72239a043589fba7d06522180bc15835854e7" 62 | integrity sha512-1pl05L51RbVLnqZTEpbgG2RxeS7VLysF7vhU8v1EOAMqbLzko64r8+S2SxsNDKODsgusFqHO8rc3w+G9VUjodw== 63 | 64 | "@rollup/rollup-win32-x64-msvc@4.0.0": 65 | version "4.0.0" 66 | resolved "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.0.0.tgz" 67 | integrity sha512-GDi4TkL95/J0ven1wt+q2cfdg1k9UEIQiF58lSC36KUdA0xtlqgLPEDlNAhu6NTXJ491eiZ71lQbLu1D7hlz9w== 68 | 69 | "@types/estree@^1.0.0": 70 | version "1.0.2" 71 | resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz" 72 | integrity sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA== 73 | 74 | estree-walker@^2.0.2: 75 | version "2.0.2" 76 | resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz" 77 | integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== 78 | 79 | fsevents@~2.3.2: 80 | version "2.3.3" 81 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" 82 | integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== 83 | 84 | picomatch@^2.3.1: 85 | version "2.3.1" 86 | resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" 87 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 88 | 89 | rollup@<5: 90 | version "4.0.0" 91 | resolved "https://registry.npmjs.org/rollup/-/rollup-4.0.0.tgz" 92 | integrity sha512-dtlkoIdp/g2glVlQb6FzhMAMzhMYVIJ3KLGjhWKkwz/ambEuHeVZ7Eg6GALhHZOsDRD+ZWSjnUikZXPyb22puQ== 93 | optionalDependencies: 94 | "@rollup/rollup-android-arm-eabi" "4.0.0" 95 | "@rollup/rollup-android-arm64" "4.0.0" 96 | "@rollup/rollup-darwin-arm64" "4.0.0" 97 | "@rollup/rollup-darwin-x64" "4.0.0" 98 | "@rollup/rollup-linux-arm-gnueabihf" "4.0.0" 99 | "@rollup/rollup-linux-arm64-gnu" "4.0.0" 100 | "@rollup/rollup-linux-x64-gnu" "4.0.0" 101 | "@rollup/rollup-linux-x64-musl" "4.0.0" 102 | "@rollup/rollup-win32-arm64-msvc" "4.0.0" 103 | "@rollup/rollup-win32-ia32-msvc" "4.0.0" 104 | "@rollup/rollup-win32-x64-msvc" "4.0.0" 105 | fsevents "~2.3.2" 106 | --------------------------------------------------------------------------------