Compare commits

...

5 Commits

Author SHA1 Message Date
André Jaenisch 2cb459b2dd
Update webpack and plugins + loaders to Webpack 5 2 months ago
pw b8dba25f25 Merge pull request 'Prepare webpack configurations for upgrade' (#138) from Ryuno-Ki/base:webpack4-config into dev 2 months ago
André Jaenisch 1a10506a7e
Prepare webpack configurations for upgrade 2 months ago
pw d2c07532df Update dependencies to v4-latest (#137) 2 months ago
André Jaenisch 2beec513ce
Update dependencies to v4-latest 2 months ago
  1. 20
      package.json
  2. 128
      webpack.common.js
  3. 7
      webpack.dev.js
  4. 13
      webpack.prod.js
  5. 14827
      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.0.4",
"mini-css-extract-plugin": "^0.9.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.0",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.45.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"
}
}

128
webpack.common.js

@ -1,65 +1,75 @@
'use strict'
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 CopyWebpackPlugin = require('copy-webpack-plugin');
const TerserJSPlugin = require('terser-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin')
const path=require('path')
const path = require('path')
module.exports = {
entry: './app.js',
stats: { children: false },
output: {
path: path.resolve(__dirname, './dist'),
filename: 'index.js'
},
optimization: {
minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],
},
resolve: {
alias: {
Main: path.resolve(__dirname, 'main/')
}
},
module: {
rules: [
{ test: /\.vue$/, loader: 'vue-loader', options:
{ transformAssetUrls: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: ['xlink:href', 'href'],
use: ['xlink:href', 'href'],
'tooltip-icon': 'src'
}
}
},
{ resourceQuery: /blockType=i18n/, type: 'javascript/auto', loader: '@intlify/vue-i18n-loader', },
{ test: /\.css$/i, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] },
{ test: /\.(mp3|ogg)$/i, loader: 'file-loader', options: {outputPath: 'audio/', esModule: false} },
{ test: /\.(gif|png|jpe?g|svg)$/i, use: [
{ loader: 'file-loader', options: { outputPath: 'img/', esModule: false } },
{ loader: 'image-webpack-loader', options: { bypassOnDebug: true, disable: true } },
]},
{ test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
use: [ { loader: 'file-loader', options: { name: '[name].[ext]', outputPath: 'fonts/' } } ]
},
{ test: /\.md$/i, use: 'raw-loader', },
]
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
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'}
])
]
entry: './app.js',
stats: { children: false },
output: {
path: path.resolve(__dirname, './dist'),
filename: 'index.js'
},
optimization: {
minimizer: [new TerserJSPlugin({}), new CssMinimizerPlugin({})]
},
resolve: {
alias: {
Main: path.resolve(__dirname, 'main/')
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options:
{
transformAssetUrls: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: ['xlink:href', 'href'],
use: ['xlink:href', 'href'],
'tooltip-icon': 'src'
}
}
},
{ resourceQuery: /blockType=i18n/, type: 'javascript/auto', loader: '@intlify/vue-i18n-loader' },
{ test: /\.css$/i, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.(mp3|ogg)$/i, loader: 'file-loader', options: { outputPath: 'audio/', esModule: false } },
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: [
{ loader: 'file-loader', options: { outputPath: 'img/', esModule: false } },
{ loader: 'image-webpack-loader', options: { bypassOnDebug: true, disable: true } }
]
},
{
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
use: [{ loader: 'file-loader', options: { name: '[name].[ext]', outputPath: 'fonts/' } }]
},
{ test: /\.md$/i, use: 'raw-loader' }
]
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css'
}),
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' }
]
})
]
}

7
webpack.dev.js

@ -1,8 +1,7 @@
const merge = require('webpack-merge');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path=require('path')
module.exports = merge(common, {
mode: 'development',
watch: true
mode: 'development',
watch: true
})

13
webpack.prod.js

@ -1,10 +1,9 @@
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const path=require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); // installed via npm
const { merge } = require('webpack-merge')
const common = require('./webpack.common.js')
const { CleanWebpackPlugin } = require('clean-webpack-plugin') // installed via npm
module.exports = merge(common, {
mode: 'production',
watch: false,
plugins: [ new CleanWebpackPlugin() ]
mode: 'production',
watch: false,
plugins: [new CleanWebpackPlugin()]
})

14827
yarn.lock

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