|
@@ -4,7 +4,7 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader');
|
|
|
-const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
+
|
|
|
|
|
|
module.exports={
|
|
|
entry:{
|
|
@@ -12,8 +12,7 @@ module.exports={
|
|
|
},
|
|
|
output:{
|
|
|
filename:"[name].js",
|
|
|
- path:path.resolve(__dirname,"./dist"),
|
|
|
- publicPath: '/',
|
|
|
+ path:path.resolve(__dirname,"./dist")
|
|
|
},
|
|
|
resolve: {
|
|
|
alias: {
|
|
@@ -24,21 +23,24 @@ module.exports={
|
|
|
rules:[
|
|
|
{
|
|
|
test: /\.html \)/,
|
|
|
- use: [{
|
|
|
- loader:'html-loader',
|
|
|
- options: {
|
|
|
- sources: {
|
|
|
- list: [
|
|
|
- { tag: 'img', attribute: 'src', type: 'src' }
|
|
|
- ]
|
|
|
- }
|
|
|
+ use: [
|
|
|
+ {
|
|
|
+ loader: 'html-loader',
|
|
|
+ options: {
|
|
|
+
|
|
|
+ sources: {
|
|
|
+ list: [
|
|
|
+ { tag: 'img', attribute: 'src', type: 'src' },
|
|
|
+ { tag: 'a', attribute: 'href', type: 'src' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }]
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
test:/\.css$/i,
|
|
|
-
|
|
|
- use:[MiniCssExtractPlugin.loader, ,"css-loader"],
|
|
|
+ use:["style-loader","css-loader"],
|
|
|
},
|
|
|
{
|
|
|
test:/\.vue$/,
|
|
@@ -58,7 +60,7 @@ module.exports={
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- test:/\.(png|jpe?g|gif|svg|webp)$/i,
|
|
|
+ test:/\.(png|jpe?g|gif|svg)$/i,
|
|
|
|
|
|
|
|
|
|
|
@@ -69,12 +71,11 @@ module.exports={
|
|
|
|
|
|
type: 'asset/resource',
|
|
|
generator:{
|
|
|
-
|
|
|
- filename: 'assets/[hash][ext][query]'
|
|
|
+ filename: "[name].[ext]",
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- test:/\.(woff2?|eof|ttf|otf)$/i,
|
|
|
+ test:/\.(woff2?|eof|ttf)$/i,
|
|
|
|
|
|
|
|
|
|
|
@@ -85,8 +86,7 @@ module.exports={
|
|
|
|
|
|
type: 'asset/resource',
|
|
|
generator:{
|
|
|
-
|
|
|
- filename: 'font/[hash][ext][query]'
|
|
|
+ filename: "./font/[name].[ext]",
|
|
|
}
|
|
|
},]
|
|
|
},
|
|
@@ -100,9 +100,6 @@ module.exports={
|
|
|
filename:"index.html",
|
|
|
chunks:['index'],
|
|
|
}),
|
|
|
- new MiniCssExtractPlugin({
|
|
|
- filename: 'css/[name].[contenthash:8].css'
|
|
|
- })
|
|
|
],
|
|
|
|
|
|
optimization: {
|