Last active
November 30, 2019 16:16
-
-
Save aliceklipper/bf26f721be80e0828f14463e98f6c53b to your computer and use it in GitHub Desktop.
Simplest config for just TS building
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { join } = require('path'); | |
const webpack = require('webpack'); | |
const DefinePlugin = webpack.DefinePlugin; | |
module.exports = { | |
target : 'web', | |
entry : './src/index.tsx', | |
output : { | |
chunkFilename : '[id].index.js', | |
filename : 'index.js', | |
path : join(process.cwd(), 'build'), | |
publicPath : `/example/`, | |
}, | |
devtool : 'source-map', | |
watch : true, | |
resolve : { extensions : ['.tsx', '.ts', '.js'] }, | |
plugins : [new DefinePlugin({ 'process.env.NODE_ENV' : JSON.stringify(process.env.NODE_ENV || 'development') })], | |
module : { | |
rules : [ | |
{ | |
test : /\.tsx?$/, | |
exclude : /node_modules/, | |
use : [{ loader : 'ts-loader' }], | |
}, | |
{ | |
test : /\.json$/, | |
exclude : /node_modules/, | |
use : [{ loader : 'json-loader' }], | |
}, | |
], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment