Created
January 6, 2019 07:01
-
-
Save anshulrgoyal/cd4f4432705e1251f9f87559a5e3e72a to your computer and use it in GitHub Desktop.
WebPack Config File
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", | |
| mode: "development", | |
| output: { | |
| filename: "./main.js" | |
| }, | |
| devServer: { | |
| contentBase: path.join(__dirname, "dist"), | |
| compress: true, | |
| port: 9000, | |
| watchContentBase: true, | |
| progress: true | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.m?js$/, | |
| exclude: /(node_modules|bower_components)/, | |
| use: { | |
| loader: "babel-loader" | |
| } | |
| }, | |
| { | |
| test: /\.css$/, | |
| use: [ | |
| "style-loader", | |
| { | |
| loader: "css-loader", | |
| options: { | |
| modules: true | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| test: /\.(png|svg|jpg|gif)$/, | |
| use: ["file-loader"] | |
| } | |
| ] | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment