Skip to content

Commit

Permalink
Configure vue
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Sep 20, 2023
1 parent 76a8266 commit 190b044
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
9 changes: 8 additions & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ module.exports = {
},
{
test: /\.vue/i,
use: 'vue-loader',
use: {
loader: 'vue-loader',
options: {
compilerOptions: {
isCustomElement: (tag) => tag === 'center',
},
},
},
},
],
},
Expand Down
7 changes: 7 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
const path = require('path');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const webpack = require('webpack');

module.exports = merge(common, {
mode: 'development',
Expand All @@ -18,4 +19,10 @@ module.exports = merge(common, {
overlay: false,
},
},
plugins: [
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: false,
__VUE_PROD_DEVTOOLS__: true,
}),
],
});
7 changes: 7 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const webpack = require('webpack');

module.exports = merge(common, {
mode: 'production',
optimization: {
// Inject a CSS minimizer alongside the default JS minimizer (the '...' is the inclusion of the default webpack JS minimizer!)
minimizer: [new CssMinimizerPlugin(), '...'],
},
plugins: [
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: false,
__VUE_PROD_DEVTOOLS__: false,
}),
],
});

0 comments on commit 190b044

Please sign in to comment.