Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

config.qqgame.ts 2.3KB

vor 5 Jahren
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 { QQgamePlugin } from './qqgame/qqgame';
  6. import { CustomPlugin } from './myplugin';
  7. import * as defaultConfig from './config';
  8. //是否使用QQ小游戏引擎插件
  9. const useQQPlugin: boolean = true;
  10. let pluginList: string[] = []
  11. const config: ResourceManagerConfig = {
  12. buildConfig: (params) => {
  13. const { target, command, projectName, version } = params;
  14. const outputDir = `../${projectName}_qqgame`;
  15. if (command == 'build') {
  16. return {
  17. outputDir,
  18. commands: [
  19. new CleanPlugin({ matchers: ["js", "resource"] }),
  20. new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
  21. new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
  22. new QQgamePlugin(useQQPlugin, pluginList),
  23. new ManifestPlugin({ output: 'manifest.js', qqPlugin: { use: useQQPlugin, pluginList: pluginList } })
  24. ]
  25. }
  26. }
  27. else if (command == 'publish') {
  28. return {
  29. outputDir,
  30. commands: [
  31. new CleanPlugin({ matchers: ["js", "resource"] }),
  32. new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
  33. new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
  34. new QQgamePlugin(useQQPlugin, pluginList),
  35. new UglifyPlugin([{
  36. sources: ["resource/default.thm.js"],
  37. target: "default.thm.min.js"
  38. }, {
  39. sources: ["main.js"],
  40. target: "main.min.js"
  41. }
  42. ]),
  43. new ManifestPlugin({ output: 'manifest.js', qqPlugin: { use: useQQPlugin, pluginList: pluginList } })
  44. ]
  45. }
  46. }
  47. else {
  48. throw `unknown command : ${params.command}`;
  49. }
  50. },
  51. mergeSelector: defaultConfig.mergeSelector,
  52. typeSelector: defaultConfig.typeSelector
  53. }
  54. export = config;