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.

config.qgame.ts 2.2KB

5 yıl önce
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /// 阅读 api.d.ts 查看文档
  2. ///<reference path="api.d.ts"/>
  3. import * as path from 'path';
  4. import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';
  5. import { MiqgamePlugin } from './qgame/qgame';
  6. import * as defaultConfig from './config';
  7. const config: ResourceManagerConfig = {
  8. buildConfig: (params) => {
  9. const { target, command, projectName, version } = params;
  10. const outputDir = `../${projectName}_qgame`;
  11. if (command == 'build') {
  12. return {
  13. outputDir,
  14. commands: [
  15. new CleanPlugin({ matchers: ["js", "resource"] }),
  16. new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
  17. new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
  18. new MiqgamePlugin(),
  19. new ManifestPlugin({ output: 'manifest.js' })
  20. ]
  21. }
  22. }
  23. else if (command == 'publish') {
  24. return {
  25. outputDir,
  26. commands: [
  27. new CleanPlugin({ matchers: ["js", "resource"] }),
  28. new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
  29. new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
  30. new MiqgamePlugin(),
  31. new UglifyPlugin([
  32. // 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
  33. // {
  34. // sources: ["resource/default.thm.js"],
  35. // target: "default.thm.min.js"
  36. // },
  37. {
  38. sources: ["main.js"],
  39. target: "main.min.js"
  40. }
  41. ]),
  42. new ManifestPlugin({ output: 'manifest.js' })
  43. ]
  44. }
  45. }
  46. else {
  47. throw `unknown command : ${params.command}`;
  48. }
  49. },
  50. mergeSelector: defaultConfig.mergeSelector,
  51. typeSelector: defaultConfig.typeSelector
  52. }
  53. export = config;