Skip to content

Commit

Permalink
fe: 添加打包二级目录
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiazhang committed Sep 24, 2021
1 parent a5aeafd commit 29801cb
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
node_modules
music/node_modules
/dist
/music


# local env files
Expand Down
Binary file added music.zip
Binary file not shown.
Binary file added public/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/msapplication-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 48 additions & 15 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,59 @@
const path = require('path')

module.exports = {
// 配置使用stylus全局变量
chainWebpack: config => {
const types = ["vue-modules", "vue", "normal-modules", "normal"];
types.forEach(type =>
addStyleResource(config.module.rule("stylus").oneOf(type))
);
publicPath: '/music/',
outputDir: 'music',
assetsDir: './static',
// ...other vue-cli plugin options...
pwa: {
name: 'FreeMusic',
themeColor: '#4DBA87',
msTileColor: '#ffffff',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'white',
iconPaths: {
appleTouchIcon: 'public/img/icons/apple-touch-icon-152x152.png',
maskIcon: 'public/img/icons/safari-pinned-tab.svg',
msTileImage: 'public/img/icons/msapplication-icon-144x144.png'
},

// configure the workbox plugin
workboxPluginMode: 'InjectManifest',
workboxOptions: {
// swSrc is required in InjectManifest mode.
swSrc: 'src/registerServiceWorker.js'
// ...other Workbox options...
}
},
devServer: {
open: process.platform === 'darwin',
// host: '192.168.199.163',
port: 8082,
https: false,
hotOnly: false,
// proxy: {}, // 设置代理
before: app => { }
},
// 配置使用stylus全局变量
chainWebpack: config => {
const types = ["vue-modules", "vue", "normal-modules", "normal"];
types.forEach(type =>
addStyleResource(config.module.rule("stylus").oneOf(type))
);
}
}


// 定义函数addStyleResource

function addStyleResource(rule) {
rule.use("style-resource")
.loader("style-resources-loader")
.options({
patterns: [
path.resolve(__dirname, "./src/common/stylus/variable.styl"),
path.resolve(__dirname, "./src/common/stylus/mixin.styl"),
]
//后面的路径改成你自己放公共stylus变量的路径
});
rule.use("style-resource")
.loader("style-resources-loader")
.options({
patterns: [
path.resolve(__dirname, "./src/common/stylus/variable.styl"),
path.resolve(__dirname, "./src/common/stylus/mixin.styl"),
]
//后面的路径改成你自己放公共stylus变量的路径
});
}

0 comments on commit 29801cb

Please sign in to comment.