I have a very simple set up that uses Webpack (1.14.0) with Extract Text Webpack Plugin (1.0.1) to generate a CSS file. The problem is that upon running webpack, no CSS artifact is produced.
Here is my webpack.config.js
:
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var path = require('path')
module.exports = {
entry: [
path.resolve(__dirname, 'src') + '/index.js'
],
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
}
]
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
},
plugins: [
new ExtractTextPlugin(path.resolve(__dirname, 'dist') + '/style.css')
]
}
As you can see this is a very simple setup. I have a folder called src
which contains a file called index.js
(that is currently blank) and style.css
(which only contains a single body style). The expectation is that the relative dist
folder contains an artifact called style.css
(which should basically be just a carbon copy of the original). The actual result is that only dist/bundle.js
is ever produced. As far as I can tell the version of Webpack and Extract Text Webpack Plugin should be compatible (the peerDependency
of Extract Text Webpack Plugin is ^1.9.11
).
What am I missing here?