Last active
October 23, 2019 23:40
-
-
Save harrisonmalone/5a1b576721a4d0a44be86853e351adf2 to your computer and use it in GitHub Desktop.
this was my webpack config for a webpack react deployment, theres an index.html in build and in the root directory, i think one of them is automatically created
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 path = require('path'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| module.exports = { | |
| mode: 'development', | |
| entry: './src/App.js', | |
| output: { | |
| path: path.resolve(__dirname, 'build'), | |
| publicPath: '/', | |
| filename: 'bundle.js' | |
| }, | |
| devServer: { | |
| contentBase: "./build", | |
| }, | |
| plugins: [ | |
| new HtmlWebpackPlugin({ | |
| template: path.resolve('./index.html'), | |
| }), | |
| ], | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, | |
| use: { | |
| loader: 'babel-loader', | |
| options: { | |
| presets: ['@babel/preset-react', { | |
| 'plugins': [ | |
| '@babel/plugin-proposal-class-properties'] | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment