Webpack loader for React Inline. Unlinke the original React Inline, this loader supports arbitrary JavaScript (or TypeScript) code.
Use the ExtractPlugin
to output all styles to an external CSS file.
We assume that the default export is the stylesheet:
// Foo.css.ts;; container: width height title: color: gray ;
The
// Foo.tsx; { return <div className=jsscontainer> <h3 className=jsstitle>Hello JSS</h3> </div> ;}
CommonJS
JavaScript is not transpiled with Babel because Babel is too large a dependency to include in this library. Avoid writing JavaScript using ES6 features that NodeJS doesn't support yet.
const constants = ;const colors = ; moduleexports = container: width: constantswidth height: constantsheight title: color: colorsgray ;
Webpack Configuration
const ExtractPlugin = ExtractPlugin; moduleexports = module: loaders: test: /\.css.$/ loader: jssLoader plugins: