Comparing version 1.0.14 to 1.0.15
@@ -6,3 +6,3 @@ /** | ||
let model = new lanurite.Models({name: "Yura"}); | ||
let model = new Lanurite.models({name: "Yura"}); | ||
document.getElementById("test").innerHTML = model.get("name"); | ||
@@ -19,3 +19,3 @@ | ||
let collection = new lanurite.Collections(); | ||
let collection = new Lanurite.collections(); | ||
@@ -22,0 +22,0 @@ collection.on("add", function (model) { |
@@ -25,3 +25,4 @@ { | ||
"main": "dist/lanurite.js", | ||
"version": "1.0.14", | ||
"typings": "src/lanurite.d.ts", | ||
"version": "1.0.15", | ||
"license": "MIT", | ||
@@ -28,0 +29,0 @@ "repository": { |
@@ -12,1 +12,14 @@ # Lanurite | ||
`<script src="../dist/lanurite.js"></script>` | ||
**For use in TypeScript** | ||
``` | ||
import Lanurite = require("../src/lanurite") | ||
console.log(Lanurite.version) | ||
``` | ||
**For use in NodeJS** | ||
``` | ||
var t = require("../dist/lanurite.js"); | ||
console.log(t.version) |
@@ -5,19 +5,6 @@ import {Models} from "./type/Models"; | ||
declare const __VERSION__: string; | ||
class Lanurite { | ||
static Models: any = Models; | ||
static Collections: any = Collections; | ||
static version: string = __VERSION__; | ||
constructor() { | ||
} | ||
} | ||
export = Lanurite | ||
if (typeof window != "undefined") { | ||
((root) => { | ||
root["lanurite"] = Lanurite; | ||
})(window); | ||
} | ||
export = { | ||
models: Models, | ||
collections: Collections, | ||
version: __VERSION__ | ||
}; |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"declaration": true, | ||
"sourceMap": true | ||
@@ -10,4 +11,5 @@ }, | ||
"exclude": [ | ||
"node_modules" | ||
"node_modules", | ||
"dist" | ||
] | ||
} |
@@ -6,11 +6,21 @@ let webpack = require("webpack"); | ||
output: { | ||
libraryTarget: "umd", | ||
library: "Lanurite", | ||
filename: './dist/lanurite.js' | ||
}, | ||
target: "node", | ||
devtool: 'source-map', | ||
resolve: { | ||
extensions: ['.webpack.js', '.web.js', '.ts', '.js'] | ||
extensions: ['.webpack.js', '.web.js', '.ts', ".js"], | ||
modules: ["src", "node_modules"] | ||
}, | ||
module: { | ||
loaders: [ | ||
{test: /\.ts$/, loader: 'ts-loader'} | ||
{ | ||
test: /\.ts$/, | ||
loader: 'ts-loader', | ||
options:{ | ||
transpileOnly: true | ||
} | ||
} | ||
] | ||
@@ -17,0 +27,0 @@ }, |
Sorry, the diff of this file is too big to display
87157
24
309
25