You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.5 KiB
59 lines
1.5 KiB
const path = require("path");
|
|
const { name } = require("./package");
|
|
|
|
function resolve(dir) {
|
|
return path.join(__dirname, dir);
|
|
}
|
|
|
|
const port = 7000; // dev port
|
|
|
|
module.exports = {
|
|
/**
|
|
* You will need to set publicPath if you plan to deploy your site under a sub path,
|
|
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
|
|
* then publicPath should be set to "/bar/".
|
|
* In most cases please use '/' !!!
|
|
* Detail: https://cli.vuejs.org/config/#publicpath
|
|
*/
|
|
outputDir: "dist",
|
|
assetsDir: "static",
|
|
filenameHashing: true,
|
|
// tweak internal webpack configuration.
|
|
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
|
|
devServer: {
|
|
// host: '0.0.0.0',
|
|
hot: true,
|
|
disableHostCheck: true,
|
|
port,
|
|
overlay: {
|
|
warnings: false,
|
|
errors: true
|
|
},
|
|
headers: {
|
|
"Access-Control-Allow-Origin": "*"
|
|
}
|
|
},
|
|
// 自定义webpack配置
|
|
configureWebpack: {
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve("src")
|
|
}
|
|
},
|
|
externals: {
|
|
'tiscom': 'TISCOM',// 业务代码中可以通过 import 'tiscom' 的方式使用,或者全局不需要再import,也可以直接使用tis-component中提供的业务组件
|
|
'vue': {
|
|
root: 'Vue',
|
|
commonjs: 'vue',
|
|
commonjs2: 'vue',
|
|
amd: 'vue'
|
|
}
|
|
},
|
|
output: {
|
|
// 把子应用打包成 umd 库格式
|
|
library: `${name}-[name]`,
|
|
libraryTarget: "umd",
|
|
jsonpFunction: `webpackJsonp_${name}`
|
|
}
|
|
}
|
|
};
|