Answer the question
In order to leave comments, you need to log in
Extract text webpack plugin not working?
The extract text webpack plugin css file collector does not work. I reviewed all the screencasts, googled, only one thing, how to connect it, and everything works right away. I have a stylus preprocessor, loaders were installed, all js files are collected, and the styles themselves are written to the style tag. But I can't seem to put the styles in a separate css file. I registered everything, I repeat, the assembly takes place in js, but I need it in css. The config is
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
context: __dirname + "/frontend",
entry: {
app: "./js/app"
},
output: {
path: __dirname + "/public/js",
publicPath: '/',
filename: "[name].js",
},
resolve:{
modulesDirectories: ["node_modules"],
extensions: ["", ".js", ".styl"]
},
resolveLoader:{
modulesDirectories: ["node_modules"],
extensions: ["", ".js", ".styl"],
moduleTemplates: ["*-loader", "*"]
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel?presets[]=es2015'
},
{ test: /\.css$/, exclude: /\.useable\.css$/, loader: "style!css" },
{ test: /\.useable\.css$/, loader: "style/useable!css" },
{ test: /\.styl$/, loader: 'style!css!stylus!' },
{ test: /\.css$/, loader: "style!css?root=." },
{ test: /\.stly$/, loader: ExtractTextPlugin.extract("style", "css!stylus!") }
]
},
plugins: [
new ExtractTextPlugin("[name].css")
]
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question