I am trying to setup Webpack(PostCSS) within a CherryPy application. Webpack appears to be generating inline styles correctly, the following is my my loader within webpack.config.js
{
test: /\.css$/,
loader: "style-loader!css-loader?modules&importLoaders=1!postcss-loader"
}
When I run 'webpack', it appears to correctly generate the 'test-class' styles from my stylesheets/main.css file inline within the main generated output.js file....
exports.push([module.id, ".W_8vO1mwnWhjGJpClgHqm {\n /* color: $matt; */\n color: green;\n background: red;\n}\n", ""]);
The generated output.js file is then included in a script tag within my main.html page. However, when I try to use the 'test-class' that is generated above, applying it has no effect on the element. In the webpack documentation, it mentions the following
// in your modules just require the stylesheet
// This has the side effect that a <style>-tag is added to the DOM.
require("./stylesheet.css");
I am unclear which module this is referring to. Any insight would be much appreciated.
edit: updating with full webpack.config.js
```
const webpack = require('webpack');
const path = require('path');
//post css
var precss = require('precss');
var autoprefixer = require('autoprefixer');
module.exports = {
context: __dirname + '/app',
entry: "./test.js",
output: {
filename: 'almostTest.js',
path: path.join(__dirname, './static')
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
},
{
test: /\.css$/,
loader: "style-loader!css-loader?modules&importLoaders=1!postcss-loader"
}
]
},
postcss: [
precss,
autoprefixer({ browsers: ['last 2 versions'] })
]
}
```