reactjs-basics icon indicating copy to clipboard operation
reactjs-basics copied to clipboard

displaying window with root directory

Open sarveshcchauhan opened this issue 7 years ago • 0 comments

react

what should I do I have add all dependencies and package

webpack Config

const webpack = require('webpack');

module.exports = {
entry: './src/app/index.js',
module: {
    rules: [
    {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: ['babel-loader']
    }
    ]
},
resolve: {
    extensions: ['*', '.js', '.jsx']
},
output: {
    path: __dirname + '/dist',
    publicPath: '/',
    filename: 'bundle.js'
},
plugins: [
    new webpack.HotModuleReplacementPlugin()
],
devServer: {
    contentBase: './dist',
    hot: true
}
};

package.json

{
  "name": "rcbasic",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "webpack-dev-server --config ./webpack.config.js --mode development",
    "test": "echo \"No test specified\" && exit 0"
  },
  "author": "sarvesh",
  "license": "ISC",
  "dependencies": {
    "babel-preset-env": "^1.7.0",
    "react": "^16.6.0",
    "react-dom": "^16.6.0",
    "react-hot-loader": "^4.3.11",
    "react-scripts": "^2.0.5"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
    "webpack": "^4.23.1",
    "webpack-cli": "^3.1.2",
    "webpack-dev-server": "^3.1.10"
  }
}

index.html file

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>REACT JS</title>
</head>
<body>
    <script src="/app/bundle.js"></script>
</body>
</html>


sarveshcchauhan avatar Oct 26 '18 08:10 sarveshcchauhan