Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

[Fixes #12] Add Browserify to build #18

Merged
merged 2 commits into from
Jan 2, 2017
Merged
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
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./pixi-multistyle-text").default;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
"license": "MIT",
"dependencies": {},
"devDependencies": {
"browserify": "^13.1.1",
"tsify": "^2.0.7",
"@types/pixi.js": "^4.3.1",
"typescript": "^2.1.4"
},
"scripts": {
"demo": "npm run build && open demo/index.html",
"build": "tsc",
"build": "tsc; browserify index.js -p tsify -s MultiStyleText -o dist/pixi-multistyle-text.js -d",
"prepublish": "npm run build"
}
}
6 changes: 3 additions & 3 deletions pixi-multistyle-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

"use strict";

interface ExtendedTextStyle extends PIXI.TextStyleOptions {
export interface ExtendedTextStyle extends PIXI.TextStyleOptions {
valign?: "top" | "middle" | "bottom";
}

interface TextStyleSet {
export interface TextStyleSet {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary/useful to export the interfaces?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's required - you can't export the MultiStyleText class if it has properties or methods that use types that wouldn't be accessible externally.

[key: string]: ExtendedTextStyle;
}

Expand All @@ -24,7 +24,7 @@ interface TextData {
fontProperties: FontProperties;
}

class MultiStyleText extends PIXI.Text {
export default class MultiStyleText extends PIXI.Text {
private textStyles: TextStyleSet;

constructor(text: string, styles: TextStyleSet) {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "none",
"module": "umd",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
Expand Down