Add TypeScript, generate stations and a line
This commit is contained in:
@@ -5,7 +5,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const env = process.env.NODE_ENV;
|
||||
|
||||
module.exports = {
|
||||
entry: './src/transport.js',
|
||||
entry: './src/transport.ts',
|
||||
output: {
|
||||
filename: 'transport.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
@@ -18,10 +18,22 @@ module.exports = {
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env'],
|
||||
presets: [
|
||||
'@babel/preset-env',
|
||||
],
|
||||
plugins: [
|
||||
'@babel/proposal-class-properties',
|
||||
'@babel/proposal-object-rest-spread',
|
||||
],
|
||||
cacheDirectory: env === 'development',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: env === 'production'
|
||||
@@ -33,6 +45,9 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: path.join(__dirname, 'index.html'),
|
||||
|
||||
Reference in New Issue
Block a user