Created
April 27, 2019 13:24
-
-
Save antosan/be80395b312d1085f5d5f5ff6b3a3cf7 to your computer and use it in GitHub Desktop.
react-webpack-demo
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"); | |
| module.exports = { | |
| entry: "./src/index.js", | |
| output: { | |
| path: path.resolve(__dirname, "build"), | |
| filename: "bundle.js", | |
| publicPath: "/build/" | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.(js|jsx)$/, | |
| exclude: /node_modules/, | |
| use: { | |
| loader: "babel-loader" | |
| } | |
| }, | |
| { | |
| test: /\.css$/, | |
| use: ["style-loader", "css-loader"] | |
| }, | |
| { | |
| test: /\.(png|svg|jpg|gif)$/, | |
| use: { | |
| loader: "file-loader" | |
| } | |
| } | |
| ] | |
| }, | |
| devServer: { | |
| contentBase: path.resolve(__dirname, "public"), | |
| port: 3000, | |
| publicPath: "/build/", | |
| open: true, | |
| overlay: true | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment