Commit 066b5987d4facfe0e23dfbbf78eb85f37a8a0f94

Authored by Aaron
1 parent 81e398bc
Exists in master and in 1 other branch legacy

优化打包组件库时的source map

Showing 2 changed files with 3 additions and 37 deletions   Show diff stats
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 "scripts": { 6 "scripts": {
7 "serve": "vue-cli-service serve", 7 "serve": "vue-cli-service serve",
8 "build": "vue-cli-service build", 8 "build": "vue-cli-service build",
9 - "lib": "vue-cli-service build --target lib --name eagle-web-toolkit --dest lib packages/index.js" 9 + "lib": "vue-cli-service build --target lib --name eagle-web-toolkit packages/index.js"
10 }, 10 },
11 "dependencies": { 11 "dependencies": {
12 "axios": "^0.19.0", 12 "axios": "^0.19.0",
@@ -11,26 +11,7 @@ module.exports = { @@ -11,26 +11,7 @@ module.exports = {
11 }, 11 },
12 // eslint-loader 是否在保存的时候检查 12 // eslint-loader 是否在保存的时候检查
13 lintOnSave: true, 13 lintOnSave: true,
14 - // webpack配置 写法1  
15 - // configureWebpack: {  
16 - // resolve: {  
17 - // alias: {  
18 - // '@': path.resolve(__dirname, 'examples'),  
19 - // }  
20 - // },  
21 - // module: {  
22 - // rules: [  
23 - // {  
24 - // test: /\.md$/,  
25 - // use: [  
26 - // 'vue-loader',  
27 - // path.resolve(__dirname, "./webpack/markdown-loader.js"),  
28 - // ],  
29 - // }  
30 - // ]  
31 - // }  
32 - // },  
33 - // webpack配置 写法2 14 + // webpack配置扩展markdown
34 configureWebpack: config => { 15 configureWebpack: config => {
35 config.resolve.alias['@'] = path.resolve(__dirname, 'examples'); 16 config.resolve.alias['@'] = path.resolve(__dirname, 'examples');
36 config.module.rules.push({ 17 config.module.rules.push({
@@ -41,22 +22,6 @@ module.exports = { @@ -41,22 +22,6 @@ module.exports = {
41 ], 22 ],
42 }); 23 });
43 }, 24 },
44 - // webpack配置 链式写法  
45 - // chainWebpack: config => {  
46 - // config.resolve.alias  
47 - // .set('@', path.resolve(__dirname, 'examples'))  
48 - // config.module  
49 - // .rule("md")  
50 - // .test(/\.md/)  
51 - // .use("vue")  
52 - // .loader("vue-loader")  
53 - // .end()  
54 - // .use("markdown")  
55 - // .loader(  
56 - // path.resolve(__dirname, "./webpack/markdown-loader.js")  
57 - // )  
58 - // .end();  
59 - // },  
60 // webpack-dev-server 相关配置 25 // webpack-dev-server 相关配置
61 devServer: { 26 devServer: {
62 open: true, 27 open: true,
@@ -66,4 +31,5 @@ module.exports = { @@ -66,4 +31,5 @@ module.exports = {
66 hotOnly: false, 31 hotOnly: false,
67 disableHostCheck: true, 32 disableHostCheck: true,
68 }, 33 },
  34 + productionSourceMap: false, // 打包组件库时不生成source map
69 } 35 }