Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test project #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,831 changes: 1,525 additions & 5,306 deletions test-project-webpack5/package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions test-project-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"prod": "rm -rf dist/ && npm run webpack -- --mode=production"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"babel-loader": "^8.2.2",
"copy-webpack-plugin": "^9.0.1",
"css-loader": "^6.1.0",
"html-webpack-plugin": "^5.3.2",
"imagemin-webp-webpack-plugin": "^3.3.4",
"mini-css-extract-plugin": "^2.1.0",
"style-loader": "^3.1.0",
"webpack": "^5.45.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2",
"@babel/core": "^7.18.9",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"html-webpack-plugin": "^5.5.0",
"imagemin-webp-webpack-plugin": "file:..",
"mini-css-extract-plugin": "^2.6.1",
"style-loader": "^3.3.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^3.11.3",
"webpack-merge": "^5.8.0"
}
}
16 changes: 1 addition & 15 deletions test-project-webpack5/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
const fs = require('fs');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { merge: webpackMerge } = require('webpack-merge');
const modeConfig = env => require(`./build-utils/webpack.${env}`)(env);


/**
* If we don't copy the plugin in this project when
* using it like this, we get a very strange error regarding
*
* > \cwebp-bin\\vendor\\cwebp.exe
*
* It seems it's trying to use it from the root `node_modules`
* but there's no `vendor` subfolder there and it fails.
*
* TODO: find a proper/better solution than this 👇
*/
fs.copyFileSync('../plugin.js', 'plugin.js');
const ImageminWebpWebpackPlugin = require('./plugin');
const ImageminWebpWebpackPlugin = require('imagemin-webp-webpack-plugin');

module.exports = (env, { mode }) =>
webpackMerge(
Expand Down
Loading