Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

60 linhas
2.1KB

  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 { VivogamePlugin } from './vivogame/vivogame';
  6. import * as defaultConfig from './config';
  7. const config: ResourceManagerConfig = {
  8. buildConfig: (params) => {
  9. const { target, command, projectName, version } = params;
  10. const outputDir = `../${projectName}_vivogame/src`;
  11. if (command == 'build') {
  12. return {
  13. outputDir,
  14. commands: [
  15. new CleanPlugin({ matchers: ["../engine/js", "resource"] }),
  16. new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
  17. new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
  18. new VivogamePlugin(),
  19. new ManifestPlugin({ output: 'manifest.js', info: { target: 'vivogame' } })
  20. ]
  21. }
  22. }
  23. else if (command == 'publish') {
  24. return {
  25. outputDir,
  26. commands: [
  27. new CleanPlugin({ matchers: ["../engine/js", "resource"] }),
  28. new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
  29. new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
  30. new VivogamePlugin(),
  31. new UglifyPlugin([{
  32. sources: ["resource/default.thm.js"],
  33. target: "default.thm.min.js"
  34. }, {
  35. sources: ["main.js"],
  36. target: "main.min.js"
  37. }
  38. ]),
  39. new ManifestPlugin({ output: 'manifest.js', info: { target: 'vivogame' } })
  40. ]
  41. }
  42. }
  43. else {
  44. throw `unknown command : ${params.command}`;
  45. }
  46. },
  47. mergeSelector: defaultConfig.mergeSelector,
  48. typeSelector: defaultConfig.typeSelector
  49. }
  50. export = config;