Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Adding clean-obsolete-chunks which will clean up on recompile (#1013)
Browse files Browse the repository at this point in the history
* adding clean-obsolete-chunks which will clean up on recompile

* adding dot between css name and hash
  • Loading branch information
paganotoni authored and markbates committed Apr 10, 2018
1 parent 5bce869 commit 7cb26b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions generators/assets/webpack/templates/package.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"repository": "github.com/gobuffalo/buffalo",
"dependencies": {
"babel-cli": "~6.26.0",
"babel-core": "~6.26.0",
"babel-loader": "~7.1.2",
"babel-preset-env": "~1.5.2",
{{ if eq .opts.Bootstrap 4 -}}
"bootstrap": "4.0.0",
{{ else -}}
"bootstrap-sass": "~3.3.7",
{{ end -}}
"clean-webpack-plugin": "~0.1.19",
"font-awesome": "~4.7.0",
"jquery": "~3.2.1",
"jquery-ujs": "~1.2.2"
},
"devDependencies": {
"babel-cli": "~6.26.0",
"babel-core": "~6.26.0",
"babel-loader": "~7.1.2",
"babel-preset-env": "~1.5.2",
"webpack-clean-obsolete-chunks": "^0.4.0",
"copy-webpack-plugin": "~4.5.1",
"css-loader": "~0.28.11",
"expose-loader": "~0.7.5",
"file-loader": "~1.1.11",
"font-awesome": "~4.7.0",
"gopherjs-loader": "^0.0.1",
"jquery": "~3.2.1",
"jquery-ujs": "~1.2.2",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "~4.8.3",
"npm-install-webpack-plugin": "4.0.5",
Expand Down
6 changes: 3 additions & 3 deletions generators/assets/webpack/templates/webpack.config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Glob = require("glob");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const ManifestPlugin = require("webpack-manifest-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const CleanObsoleteChunks = require('webpack-clean-obsolete-chunks');
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

const configurator = {
Expand Down Expand Up @@ -38,9 +38,9 @@ const configurator = {

plugins() {
var plugins = [
new CleanWebpackPlugin(["public/assets"], {verbose: false,}),
new CleanObsoleteChunks(),
new Webpack.ProvidePlugin({$: "jquery",jQuery: "jquery"}),
new MiniCssExtractPlugin({filename: "[name][contenthash].css"}),
new MiniCssExtractPlugin({filename: "[name].[contenthash].css"}),
new CopyWebpackPlugin([{from: "./assets",to: ""}], {copyUnmodified: true,ignore: ["css/**", "js/**"] }),
new Webpack.LoaderOptionsPlugin({minimize: true,debug: false}),
new ManifestPlugin({fileName: "manifest.json"})
Expand Down

0 comments on commit 7cb26b6

Please sign in to comment.