Skip to content

Instantly share code, notes, and snippets.

@GeoffCapper
Created July 9, 2020 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeoffCapper/9be1acf4c37f256584e1087f1e634ac3 to your computer and use it in GitHub Desktop.
Save GeoffCapper/9be1acf4c37f256584e1087f1e634ac3 to your computer and use it in GitHub Desktop.
Tests For TS Build 62630302
export let myvariable = 'hello world!';
'use strict';
const gulp = require('gulp');
const browserify = require('browserify');
const source = require("vinyl-source-stream");
// const tsify = require('tsify');
gulp.task('compile', function (finished) {
console.log('Compiling scripts.');
browserify({
standalone: 'main'
})
.add('src/scripts/scriptloader.ts')
.plugin("tsify", {
noImplicitAny: false,
module: 'CommonJS'
})
.transform("babelify")
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('debug/js')).on('end', function () {
finished();
});
});
<html>
<body>
<h1>Test</h1>
<script src="debug/js/bundle.js"></script>
</body>
</html>
import { myvariable } from './globalvars';
console.log(myvariable);
@GeoffCapper
Copy link
Author

GeoffCapper commented Jul 9, 2020

Test files for a StackOverflow problem. Presumes .ts files are in src/scripts/ and .html is in root of directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment