0.18.0 • Published 2 months ago

@chialab/esbuild-plugin-css-import v0.18.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Install

$ npm i @chialab/esbuild-plugin-css-import -D
$ yarn add @chialab/esbuild-plugin-css-import -D

Usage

This plugin enables the node resolution algorithm for CSS files. That means that @import and @url() statements can refer to both relative files and NPM packages. CSS modules must have the style field in their pakcage.json in order to correctly pickup the CSS entrypoint.

import esbuild from 'esbuild';
import cssImportPlugin from '@chialab/esbuild-plugin-css-import';

await esbuild.build({
    plugins: [
        cssImportPlugin(),
    ],
});

Example

node_modules/css-framework/package.json

{
    "name": "css-framework",
    "style": "index.css"
}

node_modules/css-framework/index.css

:root {
    --accent-color: #000;
}

src/main.css

@import 'css-framework';

body {
    color: var(--accent-color);
}

License

Esbuild Plugin CSS Import is released under the MIT license.

0.19.0-beta.0

2 months ago

0.18.0

4 months ago

0.18.0-alpha.1

9 months ago

0.18.0-alpha.0

1 year ago

0.17.1

2 years ago

0.17.0

2 years ago

0.16.0

2 years ago

0.15.28

2 years ago

0.15.9

2 years ago

0.15.0

2 years ago

0.15.2

2 years ago

0.15.3

2 years ago

0.14.11

2 years ago

0.14.10

2 years ago

0.14.17

2 years ago

0.14.0

2 years ago

0.13.13

2 years ago

0.14.1

2 years ago

0.14.2

2 years ago

0.15.0-alpha.1

2 years ago

0.14.4

2 years ago

0.13.11

2 years ago

0.13.8

2 years ago

0.13.2

2 years ago

0.13.0

2 years ago