Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

61 line
2.1KB

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