Skip to content

Commit

Permalink
⚡ 减少项目打包体积,去除不必要的sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
muwoo committed Oct 13, 2023
1 parent 0233bda commit 9eb59a9
Show file tree
Hide file tree
Showing 85 changed files with 127 additions and 193 deletions.
22 changes: 18 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
presets: ['@vue/cli-plugin-babel/preset'],
plugins: [
[
"import",
{ libraryName: "ant-design-vue", libraryDirectory: "es", style: "css" },
], // `style: true` 会加载 less 文件
'import',
{
libraryName: 'ant-design-vue',
libraryDirectory: 'es',
style: 'css', // or 'css'
},
'ant-design-vue',
],
[
'import',
{
libraryName: '@ant-design/icons-vue',
libraryDirectory: 'lib/icons',
camel2DashComponentName: false,
},
'@ant-design/icons-vue',
],
],
};
16 changes: 10 additions & 6 deletions detach/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
const path = require("path");
const path = require('path');

module.exports = {
css: { // 配置css模块
loaderOptions: { // 向预处理器 Loader 传递配置选项
less: { // 配置less(其他样式解析用法一致)
css: {
// 配置css模块
loaderOptions: {
// 向预处理器 Loader 传递配置选项
less: {
// 配置less(其他样式解析用法一致)
javascriptEnabled: true, // 设置为true
},
},
},
outputDir: path.join(__dirname, "../public/detach"),
publicPath: process.env.NODE_ENV === "production" ? "" : "/",
productionSourceMap: false,
outputDir: path.join(__dirname, '../public/detach'),
publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
};
1 change: 1 addition & 0 deletions feature/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
},
},
},
productionSourceMap: false,
outputDir: path.join(__dirname, '../public/feature'),
publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
// chainWebpack: (config) => {
Expand Down
1 change: 1 addition & 0 deletions guide/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
},
},
},
productionSourceMap: false,
outputDir: path.join(__dirname, '../public/guide'),
publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "4.0.1",
"version": "4.0.2",
"author": "muwoo <2424880409@qq.com>",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/detach/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>detach</title><link href="css/app.65d55ce4.css" rel="preload" as="style"><link href="js/app.7471434d.js" rel="preload" as="script"><link href="js/chunk-vendors.29c10bf6.js" rel="preload" as="script"><link href="css/app.65d55ce4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but detach doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.29c10bf6.js"></script><script src="js/app.7471434d.js"></script></body></html>
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>detach</title><link href="css/app.65d55ce4.css" rel="preload" as="style"><link href="js/app.bc494a66.js" rel="preload" as="script"><link href="js/chunk-vendors.b36194a6.js" rel="preload" as="script"><link href="css/app.65d55ce4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but detach doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.b36194a6.js"></script><script src="js/app.bc494a66.js"></script></body></html>
2 changes: 0 additions & 2 deletions public/detach/js/app.7471434d.js

This file was deleted.

Loading

0 comments on commit 9eb59a9

Please sign in to comment.