I have only got the JS file in the output whereas i have used the ExtractTextPlugin to extract the Css file.Both have chunkhash in their names.My problem is that a new chunkhash is only created when changes are made to the JS and not to the css. I want new chunkhash for changes in the Css file as well. Here in my webpack.config.js file.
var webpack = require("webpack");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
plugins: [new HtmlWebpackPlugin(),
new ExtractTextPlugin("styles.[chunkhash].css")
],
entry: {
main: './src/main1.js',
},
output: {
path: __dirname + "/dist", // or path: path.join(__dirname,
"dist/js"),
filename: "[name].[chunkhash].js"
},
module : {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query:{
presets:['es2015']
}
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader',
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}
]
}
};
and heres the main.js file
var msgs = require('./main2');
require('./css/css1.css');
main2.js is just another file where another variable is defined