You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2019. It is now read-only.
Uh oh!
There was an error while loading. Please reload this page.
When I use "ts-loader" in webpack, it's not happend.
But with "awesome-typescript-loader", it show this error in Chrome console log.
My webpack config:
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
var basePath = __dirname;
module.exports = {
context: path.join(basePath, 'App'),
resolve: {
extensions: ['.js', '.ts', '.tsx']
},
entry: {
app: './index.tsx',
appStyles:'./css/site.css',
vendor: [
'react',
'react-dom',
'react-router',
],
vendorStyles: [
'../node_modules/bootstrap/dist/css/bootstrap.css',
],
},
output: {
path: path.join(basePath, 'wwwroot'),
filename: '[name].js',
},
module: {
rules: [
{
test: /.ts$/,
exclude: [/node_modules/],
loader: 'awesome-typescript-loader',
// loader: 'ts-loader',
options: {
useBabel: true,
},
},
{
test: /.tsx$/,
exclude: [/node_modules/],
loader: 'awesome-typescript-loader',
// loader: 'ts-loader',
options: {
useBabel: true,
},
},
{
test: /.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
],
},
// Loading glyphicons => https://github.com/gowravshekar/bootstrap-webpack
// Using here url-loader and file-loader
{
test: /.(woff|woff2)(?v=\d+.\d+.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /.ttf(?v=\d+.\d+.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{
test: /.eot(?v=\d+.\d+.\d+)?$/,
loader: 'file-loader'
},
{
test: /.svg(?v=\d+.\d+.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
},
],
},
// For development https://webpack.js.org/configuration/devtool/#for-development
devtool: 'inline-source-map',
plugins: [
//Generate index.html in /dist => https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html', //Name of file in ./dist/
template: 'index.html', //Name of template in ./src
hash: true,
}),
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest'],
}),
],
};
My tsconfig file:
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"moduleResolution": "node",
"declaration": false,
"noImplicitAny": false,
"sourceMap": true,
"jsx": "react",
"noLib": false,
"suppressImplicitAnyIndexErrors": true
},
"compileOnSave": false,
"exclude": [
"node_modules"
]
}
My code:
var longProcess = () => {
let result = 0;
return new Promise((resolve, reject) => {
setTimeout(()=> {
for (let i = 0; i <= 250000000 - 1; i++) {
result++;
}
resolve(result);
},0);
});
}
async function processAsync() {
console.log('Start 1');
let result1 = await longProcess().then((res) => console.log(res));
console.log('End 1');
console.log('Start 2');
let result2 = await longProcess().then((res) => console.log(res));
console.log('End 2');
}
processAsync();
console.log("End");
The text was updated successfully, but these errors were encountered: