tis-cli前端项目快速搭建命令行工具
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

  1. const path = require("path");
  2. const { name } = require("./package");
  3. function resolve(dir) {
  4. return path.join(__dirname, dir);
  5. }
  6. const port = 7000; // dev port
  7. module.exports = {
  8. /**
  9. * You will need to set publicPath if you plan to deploy your site under a sub path,
  10. * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
  11. * then publicPath should be set to "/bar/".
  12. * In most cases please use '/' !!!
  13. * Detail: https://cli.vuejs.org/config/#publicpath
  14. */
  15. outputDir: "dist",
  16. assetsDir: "static",
  17. filenameHashing: true,
  18. // tweak internal webpack configuration.
  19. // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
  20. devServer: {
  21. // host: '0.0.0.0',
  22. hot: true,
  23. disableHostCheck: true,
  24. port,
  25. overlay: {
  26. warnings: false,
  27. errors: true
  28. },
  29. headers: {
  30. "Access-Control-Allow-Origin": "*"
  31. }
  32. },
  33. // 自定义webpack配置
  34. configureWebpack: {
  35. resolve: {
  36. alias: {
  37. "@": resolve("src")
  38. }
  39. },
  40. externals: {
  41. 'tiscom': 'TISCOM',// 业务代码中可以通过 import 'tiscom' 的方式使用,或者全局不需要再import,也可以直接使用tis-component中提供的业务组件
  42. 'vue': {
  43. root: 'Vue',
  44. commonjs: 'vue',
  45. commonjs2: 'vue',
  46. amd: 'vue'
  47. }
  48. },
  49. output: {
  50. // 把子应用打包成 umd 库格式
  51. library: `${name}-[name]`,
  52. libraryTarget: "umd",
  53. jsonpFunction: `webpackJsonp_${name}`
  54. }
  55. }
  56. };