Chike1990 / TodoList

MIT License
1 stars 0 forks source link

Peer-to-peer code review #5

Open VanessaAoki opened 3 years ago

VanessaAoki commented 3 years ago

Hi @Chike1990,

First of all, great work so far!

In order to be able to run $ npm start you have to enable watch mode, to do so, you should follow these steps:

  1. Run $ npm install --save-dev webpack-dev-server inside your project folder;
  2. In your webpack.config.js file, should add the lines between **:
    module.exports = {
    entry: './src/index.js',
    mode: "none",
    output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist'),
    },
    **devServer: {
    contentBase: './dist',
    },**
    module: {
    rules: [
      {
        test: /\.css$/i,
        use: ['style-loader', 'css-loader'],
      },
    ],
    },
    plugins: [
    new HtmlWebpackPlugin({
      template: './src/index.html'
    }),
    ],
    };
  3. In your package.json file you should add the following line inside scripts: "start": "webpack serve --open",

    Your file should be looking like this:

    {
    "name": "todo",
    "version": "1.0.0",
    "description": "",
    "private": true,
    "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "webpack serve --open",
    "build": "webpack"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "css-loader": "^6.2.0",
    "html-webpack-plugin": "^5.3.2",
    "style-loader": "^3.2.1",
    "webpack": "^5.51.0",
    "webpack-cli": "^4.8.0",
    "webpack-dev-server": "^4.0.0"
    },
    "dependencies": {
    "lodash": "^4.17.21"
    }
    }
  4. Lastly just run $ npm start and it should start a live server, from your compiled files!

Keep up the great work!

Chike1990 commented 3 years ago

Thanks a lot, Vanessa

Chibuike

On Thu, Aug 19, 2021 at 3:58 PM VanessaAoki @.***> wrote:

Hi @Chike1990 https://github.com/Chike1990,

First of all, great work so far!

In order to be able to run $ npm start you have to enable watch mode, you should follow these steps:

  1. Run $ npm install --save-dev webpack-dev-server inside your project folder;
  2. In your webpack.config.js file, should add the lines between **:

module.exports = { entry: './src/index.js', mode: "none", output: { filename: 'main.js', path: path.resolve(__dirname, 'dist'), }, devServer: { contentBase: './dist', }, module: { rules: [ { test: /.css$/i, use: ['style-loader', 'css-loader'], }, ], }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html' }), ], };

  1. In your package.json file you should add the following line inside scripts: "start": "webpack serve --open",

Your file should be looking like this:

{ "name": "todo", "version": "1.0.0", "description": "", "private": true, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack serve --open", "build": "webpack" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "css-loader": "^6.2.0", "html-webpack-plugin": "^5.3.2", "style-loader": "^3.2.1", "webpack": "^5.51.0", "webpack-cli": "^4.8.0", "webpack-dev-server": "^4.0.0" }, "dependencies": { "lodash": "^4.17.21" } }

  1. Lastly just run $ npm start and it should start a live server, from your compiled files!

Keep up the great work!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Chike1990/TodoList/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO2A5OGH7F5U44KOHIL6SPDT5ULZBANCNFSM5CONBP4Q .