Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Export static image assets #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 110 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion src/exportProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { indent, log, setVerbose, verbose } from './log';
*/
const DOJO_EXCLUDE = /@dojo\/loader\/interfaces\.d\.ts$/;

const DEFAULT_EXTENSIONS = 'ts,tsx,html,css,json,xml,md,svg,jpg,jpeg,png,gif';

export let requireResolve = resolveCwd;

export type StringMap = { [ pkg: string ]: string; };
Expand Down Expand Up @@ -169,6 +171,15 @@ function getProjectFileType(name: string): ProjectFileType {
return ProjectFileType.XML;
case '.md':
return ProjectFileType.Markdown;
case '.svg':
return ProjectFileType.SVG;
case '.jpg':
case '.jpeg':
return ProjectFileType.JPEG;
case '.png':
return ProjectFileType.PNG;
case '.gif':
return ProjectFileType.GIF;
default:
return ProjectFileType.PlainText;
}
Expand Down Expand Up @@ -252,7 +263,7 @@ async function addDependencies(project: ProjectJson) {
* @param project The reference to the project bundle
* @param includeExtensions A comma deliminated string of extensions to be included in the project files
*/
async function addProjectFiles(project: ProjectJson, includeExtensions: string = 'ts,tsx,html,css,json,xml,md') {
async function addProjectFiles(project: ProjectJson, includeExtensions: string = DEFAULT_EXTENSIONS) {
if (project.tsconfig.include) {
const globs = await Promise.all(
project.tsconfig.include
Expand Down
6 changes: 5 additions & 1 deletion src/interfaces/project.json.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,9 @@ export const enum ProjectFileType {
JSON,
XML,
SourceMap,
PlainText
PlainText,
SVG,
PNG,
JPEG,
GIF
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const command: Command<ExportArgs> = {
options('c', {
alias: 'content',
describe: 'A comma separated list of extensions of files to include in the project files. Defaults to ' +
'"ts,html,css,json,xml,md".',
'"ts,tsx,html,css,json,xml,md,svg,jpg,jpeg,png,gif".',
type: 'string'
});

Expand Down
Loading