Giter Site home page Giter Site logo

webpack_conf's People

Contributors

benjaminpreiss avatar

Watchers

 avatar

webpack_conf's Issues

Split wepack configuration with webpack merge

As described in this article webpack configuration can be split.

After splitting we should have three files:

  1. base file: configurtion shared between production and development
  2. prod file: configuration unique to production
  3. dev file: configuration unique to development

Add sourceType parserOptions to **.eslintrc**

When using import and export in js files eslint produces and error:

'import' and 'export' may appear only with 'sourceType: module'

That can be mitigated by adding the following parser options to .eslintrc:

    "parserOptions": {
        "sourceType": "module"
    }

Improve README vscode stylelint settings.json

Explain how to configure vscode stylelint extension to be

  1. enabled
  2. not conflicting with the built in vs code extensions.

How to:

  1. Add a folder .vscodein the workspace folder
  2. Add a file to this folder called settings.json
  3. Add the following lines to this settings.json:
{
    "window.zoomLevel": -1,
    "css.validate": false,
    "less.validate": false,
    "scss.validate": false,
    "stylelint.enable": true
}

add styleLint support

integrate stylelint and add it to npm linting tests.

Also install vscode extension!

Add chunks option to html webpack plugin

Generating more than one html file leaves the question which html file should contain which files specified in the webpack config entries.

This can be defined with the chunks option.

For every htmlwebpackplugin instance, declare the entry-name which should be used.
E.g. for lemon.html we would take the 'lemon' entry:

    new HtmlWebpackPlugin({
      chunks: ['lemon'],
      template: './src/html/lemon.html',
      filename: './html/lemon.html',
    }),

Add Q&A.md

Q&A.md should be a list of questions that appear when implementing a website.

Add font file-loader to webpack

in case of dedicated font files (e.g. usage of @font-face):

  1. provide a file-loader to load the fonts
  2. add a resolve rule for these font-urls

Modify Readme with VS Code window reload instruction

Add a last step to README.md install instructions:

Whenever changes to configuration files are made, reload the window in VS Code:

  1. Ctrl + Shift + P
  2. type Reload Window

This has to be done to make extensions reload their configuration files (e.g. stylelint and .stylelintrc)

Two webpack configuration files depending on mode

Create two configuration files for webpack:

  1. webpack_production.config.js
  2. webpack_development.config.js

For production mode:

  1. mode: production
  2. Omit devtool option
  3. Output files to dist folder

For development mode:

  1. mode: development
  2. devtool: 'source-map'
  3. Output files to dev-server

Don't forget to add corresponding entries in package.json for each mode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.