Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // webpack.config.js
- const webpack = require("webpack");
- const path = require("path");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- module.exports = {
- mode: "development",
- target: "web",
- devtool: "cheap-module-source-map",
- entry: "./src/index",
- output: {
- path: path.resolve(__dirname, "build"),
- publicPath: "/",
- filename: "bundle.js"
- },
- devServer: {
- stats: "minimal",
- overlay: true,
- historyApiFallback: true,
- disableHostCheck: true,
- headers: { "Access-Control-Allow-Origin": "*" },
- https: false
- },
- plugins: [
- new HtmlWebpackPlugin({
- template: "src/index.html",
- favicon: "src/favicon.ico"
- })
- ],
- module: {
- rules: [
- {
- test: /\.(js|jsx)$/,
- exclude: /node_modules/,
- use: ["babel-loader", "eslint-loader"]
- },
- {
- test: /(\.css)$/,
- use: ["style-loader", "css-loader"]
- }
- ]
- }
- };
- // package.json
- {
- "name": "react-custom",
- "version": "1.0.0",
- "description": "custom react env",
- "main": "index.js",
- "scripts": {
- "start": "NODE_ENV=development webpack-dev-server --config webpack.config.js --port 3000"
- },
- "author": "Author Name",
- "license": "MIT",
- "devDependencies": {
- "@babel/core": "^7.7.4",
- "babel-eslint": "^10.0.3",
- "babel-loader": "^8.0.6",
- "babel-preset-react-app": "^9.0.2",
- "css-loader": "^3.2.1",
- "eslint": "^6.7.2",
- "eslint-loader": "^3.0.2",
- "eslint-plugin-import": "^2.18.2",
- "eslint-plugin-react": "^7.17.0",
- "html-webpack-plugin": "^3.2.0",
- "style-loader": "^1.0.1",
- "webpack": "^4.41.2",
- "webpack-cli": "^3.3.10",
- "webpack-dev-server": "^3.9.0"
- },
- "engines": {
- "node": ">=8"
- },
- "dependencies": {
- "react": "^16.12.0",
- "react-dom": "^16.12.0"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment