init framework
This commit is contained in:
52
demo/scripts/config.ios.ts
Normal file
52
demo/scripts/config.ios.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_ios/assets/game`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new ManifestPlugin({ output: 'manifest.json' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new UglifyPlugin([{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.json' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
Reference in New Issue
Block a user