Created
February 21, 2021 15:12
-
-
Save yakkomajuri/8b03526b8b67b5a1041fa49694eb970a to your computer and use it in GitHub Desktop.
This file contains 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
// webpack.config.js | |
const path = require('path') | |
const webpack = require('webpack') | |
module.exports = { | |
entry: './src/index.tsx', // our entry point, as mentioned earlier | |
mode: 'development', | |
module: { | |
rules: [ | |
{ | |
test: /\.[jt]sx?$/, // matches .js, .ts, and .tsx files | |
loader: 'babel-loader', // uses babel-loader for the specified file types (no ts-loader needed) | |
exclude: /node_modules/, | |
}, | |
{ | |
test: /\.css$/, // matches .css files only (i.e. not .scss, etc) | |
use: ['style-loader', 'css-loader'], | |
}, | |
], | |
}, | |
resolve: { | |
extensions: ['.tsx', '.ts', '.js'], | |
}, | |
output: { | |
filename: 'bundle.js', // our output bundle | |
}, | |
devServer: { | |
contentBase: path.join(__dirname, 'public/'), | |
port: 3000, | |
publicPath: 'http://localhost:3000/dist/', | |
hotOnly: true, | |
}, | |
plugins: [new webpack.HotModuleReplacementPlugin()], // used for hot reloading when developing | |
devtool: 'eval-source-map', // builds high quality source maps | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment