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

Commit

Permalink
fix: Fix exported module (#18)
Browse files Browse the repository at this point in the history
Fixes #12 
* Add Browserify to build
* Don't wrap in a module if exporting globally
  • Loading branch information
bluepichu authored and tleunen committed Jan 2, 2017
1 parent 6aa7636 commit cf527eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
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 {
[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

0 comments on commit cf527eb

Please sign in to comment.