Output CSS to different directory with ExtractTextPlugin
See original GitHub issueI’m using the ExtractTextPlugin to build a separate CSS file. It works great but I’d really like to output the CSS into a different directory than the JS:
module.exports = {
entry: {
module: "./source/javascripts/app.js",
},
output: {
path: './source/built/',
filename: 'app.js'
},
module: {
loaders:[
{
test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader')
}
]
},
plugins: [
new ExtractTextPlugin('app.css')
]
};
Currently both files go into ./source/built
, is there a way to change this?
Issue Analytics
- State:
- Created 8 years ago
- Comments:21 (2 by maintainers)
Top Results From Across the Web
Webpack output files to different directories - Stack Overflow
css $/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }, { test: /\.
Read more >Webpack Separate CSS - Medium
How to separate CSS from JS using Webpack (CSS bundle). ... ExtractTextPlugin: Extract text from a bundle, or bundles, into a separate file....
Read more >MiniCssExtractPlugin - webpack
In the example below, we'll use filename to output the generated css into a different directory. webpack.config.js const MiniCssExtractPlugin = require("mini- ...
Read more >mini-css-extract-plugin - npm
Compared to the extract-text-webpack-plugin: Async loading; No duplicate compilation (performance); Easier to use; Specific to CSS ...
Read more >Angular Data Grid: Angular Webpack 2 - AG Grid
helpers'); var path = require('path'); var ExtractTextPlugin ... [ext]' }, { // site wide css (excluding all css under the app dir) test:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This worked for me…
This actually was a similar problem I was facing and andreypopp’s answer solved it for me. Specifically, what worked for me was: