Browse Source

Update webpack and plugins + loaders to Webpack 5

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
webpack5
André Jaenisch 2 months ago
parent
commit
2cb459b2dd
Signed by: ryuno-ki
GPG Key ID: 5A668E771F1ED854
  1. 20
      package.json
  2. 24
      webpack.common.js
  3. 2
      webpack.dev.js
  4. 2
      webpack.prod.js
  5. 3043
      yarn.lock

20
package.json

@ -60,18 +60,18 @@
},
"devDependencies": {
"@intlify/vue-i18n-loader": "^0.6.1",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.2",
"css-loader": "^3.6.0",
"file-loader": "^5.1.0",
"image-webpack-loader": "^5.1.0",
"mini-css-extract-plugin": "^0.12.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^7.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.0.0",
"file-loader": "^6.2.0",
"image-webpack-loader": "^8.1.0",
"mini-css-extract-plugin": "^2.6.1",
"nodemon": "^2.0.7",
"optimize-css-assets-webpack-plugin": "^6.0.1",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2"
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-merge": "^5.8.0"
}
}

24
webpack.common.js

@ -2,7 +2,7 @@
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const TerserJSPlugin = require('terser-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin')
const path = require('path')
@ -15,17 +15,13 @@ module.exports = {
filename: 'index.js'
},
optimization: {
minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})]
minimizer: [new TerserJSPlugin({}), new CssMinimizerPlugin({})]
},
resolve: {
alias: {
Main: path.resolve(__dirname, 'main/')
}
},
node: {
Buffer: false,
process: false
},
module: {
rules: [
{
@ -66,12 +62,14 @@ module.exports = {
filename: '[name].css',
chunkFilename: '[id].css'
}),
new CopyWebpackPlugin([
{ from: './html/index.html' },
{ from: './html/favicon.ico' },
{ from: './html/apple-touch-icon.png' },
{ from: './html/android-icon.png' },
{ from: './html/manifest.json' }
])
new CopyWebpackPlugin({
patterns: [
{ from: './html/index.html' },
{ from: './html/favicon.ico' },
{ from: './html/apple-touch-icon.png' },
{ from: './html/android-icon.png' },
{ from: './html/manifest.json' }
]
})
]
}

2
webpack.dev.js

@ -1,4 +1,4 @@
const merge = require('webpack-merge');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {

2
webpack.prod.js

@ -1,4 +1,4 @@
const merge = require('webpack-merge')
const { merge } = require('webpack-merge')
const common = require('./webpack.common.js')
const { CleanWebpackPlugin } = require('clean-webpack-plugin') // installed via npm

3043
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save