lib/generators/rocket_cms/templates/webpack.config.js in rocket_cms-0.26.1 vs lib/generators/rocket_cms/templates/webpack.config.js in rocket_cms-0.27.0
- old
+ new
@@ -2,44 +2,46 @@
var path = require('path');
var webpack = require('webpack');
var ManifestPlugin = require('webpack-manifest-plugin');
-var ExtractTextPlugin = require("extract-text-webpack-plugin");
+var MiniCssExtractPlugin = require("mini-css-extract-plugin");
var autoprefixer = require('autoprefixer');
var CompressionPlugin = require("compression-webpack-plugin");
var host = process.env.HOST || 'localhost'
var devServerPort = <%= port %>;
var production = process.env.NODE_ENV === 'production';
-const extractSass = new ExtractTextPlugin({
- filename: production ? "[name]-[chunkhash].css" : "[name].css",
+const extractSass = new MiniCssExtractPlugin({
+ filename: production ? "[name].[chunkhash].css" : "[name].css",
});
var sassExtractor = () => {
- return ['extracted-loader'].concat(extractSass.extract({
- use: [{
+ return [
+ {
+ loader: "extracted-loader",
+ },
+ MiniCssExtractPlugin.loader,
+ {
loader: "babel-loader",
options: {
cacheDirectory: true
}
- }, {
+ },
+ {
loader: "css-loader",
options: {
- minimize: !production,
- sourceMap: !production,
+ sourceMap: true
}
}, {
loader: "sass-loader",
options: {
- sourceMap: !production,
- includePaths: [path.resolve(__dirname, "..", "webpack")]
+ sourceMap: true
}
- }],
- fallback: "style-loader"
- }));
+ }
+ ]
}
var config = {
mode: production ? "production" : "development",
entry: {