This commit is contained in:
张成
2022-08-03 16:04:18 +08:00
parent 9fe65778e4
commit f4f59fd64d
2 changed files with 41 additions and 21 deletions

View File

@@ -95,23 +95,23 @@
</div> </div>
</template> </template>
<script> <script>
import { common } from '../static/common'; import { common } from '../static/common'
export default { export default {
data() { data() {
return { return {
menus: window.config.menus, menus: window.config.menus
}; }
}, },
mounted: function () { mounted: function () {
common.init(); common.init()
common.initListeners(); common.initListeners()
common.initHeader(); common.initHeader()
common.initForms(); common.initForms()
common.initMobileMenu(); common.initMobileMenu()
common.adjustElementsForScreen(); common.adjustElementsForScreen()
}, }
}; }
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->

View File

@@ -17,21 +17,41 @@ module.exports = {
config.resolve.alias.set("@", resolve("src")); config.resolve.alias.set("@", resolve("src"));
config.resolve.alias.set("_c", resolve("src/components")); config.resolve.alias.set("_c", resolve("src/components"));
config.module.rule('images').test(/\.(png|jpe?g|gif)(\?.*)?$/).use('url-loader').loader('url-loader').options({
limit: 10000,
esModule: false,
outputPath: "images/"
})
config.module.rule('images') config.module.rule('images')
.test(/\.(png|jpe?g|gif|svg)(\?.*)?$/) .test(/\.(png|jpe?g|gif)(\?.*)?$/)
.use('image-webpack-loader') .use('image-webpack-loader')
.loader('image-webpack-loader') .loader('image-webpack-loader')
.options({ .options({
bypassOnDebug: true, bypassOnDebug: true,
mozjpeg: {
progressive: true,
quality: 65
},
optipng: {
enabled: false,
},
pngquant: {
quality: [0.65, 0.90],
speed: 4
},
gifsicle: {
interlaced: false,
},
webp: {
quality: 75
}
}) })
config.module.rule('images').use('url-loader').loader('url-loader').options({
limit: 2,
esModule: false,
outputPath: "img/"
})
}, },