Skip to content

SilentCicero/csjs-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

csjs-loader

Webpack loader to extract csjs into an external css bundle.

npm install --save-dev csjs-loader

Usage

To use this plugin, create a seperate files for each CSJS module. For example:

main.csjs.js

const csjs = require('csjs');

module.exports = csjs`

.foo {
  color: red;
}

`;

Webpack

Use csjs-loader with extract-text-webpack-plugin

var ExtractTextPlugin = require('extract-text-webpack-plugin');

...

loaders: [
  { test: /\.csjs.js$/, loader: ExtractTextPlugin.extract("style-loader", 'css!csjs!babel!') }
],
plugins: [
  new ExtractTextPlugin('bundle.css', {allChunks: true})
]

Limitations

  • Your CSJS files must export the result of a CSJS tagged template string
  • Your CSJS files (and any dependencies) must be executable natively on your version of Node without any transpilation or browserify transforms

About

A csjs loader for webpack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages