UNPKG

1.86 kBJavaScriptView Raw
1"use strict";
2
3const pack = require("./package.json");
4
5// Load TypeScript from our dependencies
6try {
7 var typescript = require("typescript");
8} catch(e) {
9 console.error("Couldn't load some dependencies; try running 'npm install'");
10 process.exit(1);
11}
12
13// Compiler options on the server
14// typescript goes to gulp-typescript
15const server = {
16 typescript: {
17 module: "commonjs",
18 target: "ES5",
19 moduleResolution: "node",
20 typescript: typescript,
21 noEmitOnError: true,
22 experimentalDecorators: true,
23 noLib: true
24 },
25 browserify: {
26 standalone: "armature",
27 bare: true
28 }
29};
30
31const tests = {
32 tyepscript: Object.assign({}, server.typescript, {
33 allowJs: true
34 })
35}
36
37const config = {
38 browsersync: false,
39
40 // Default preset
41 preset: "default",
42
43 // Collection of presets
44 presets: {
45 default: {
46 watch: true,
47 sourcemaps: true,
48 minify: false,
49 out: "es5"
50 }
51 },
52
53 // List of pipelines to build and use
54 pipelines: [
55 {
56 id: "lib",
57 name: "Library (CommonJS)",
58 config: server,
59 type: "server",
60
61 input: "src/**/*.ts",
62 output: "",
63
64 extraEntries: ["node_modules/typescript/lib/lib.es6.d.ts", "typings/index.d.ts"],
65
66 typingsOutput: "",
67 typingsOutputType: "module",
68 moduleName: pack.name,
69 moduleEntryPoint: "index.ts"
70 },
71 {
72 id: "bundle",
73 name: "Browser (Browserify)",
74 config: server,
75 type: "browser",
76
77 input: "src/index.ts",
78 output: "bundle.js",
79
80 extraEntries: ["node_modules/typescript/lib/lib.es6.d.ts", "typings/index.d.ts"]
81 },
82 {
83 id: "tests",
84 name: "Tests (Bundle)",
85 config: tests,
86 type: "browser",
87
88 input: "tests/main.js",
89 output: "test.js",
90
91 extraEntries: ["node_modules/typescript/lib/lib.es6.d.ts", "typings/index.d.ts"]
92 },
93 ]
94};
95
96module.exports = config;
\No newline at end of file