1. 2webpack2
Turn configuration of webpack 1 to 2
2webpack2
Package: 2webpack2
Created by: QingWei-Li
Last modified: Sun, 12 Jun 2022 14:07:05 GMT
Version: 1.2.1
License: MIT
Downloads: 68
Repository: https://github.com/QingWei-Li/2webpack2

Install

npm install 2webpack2
yarn add 2webpack2

2webpack2

Build Status
Coverage Status
npm

https://webpack.js.org/how-to/upgrade-from-webpack-1

🕳️ Turn configuration of webpack 1 to 2

Installation

 npm i 2webpack2 webpack@beta -D

Usage

 var to2 = require('2webpack2')

module.exports = to2({
  debug: true,
  module: {
    preLoaders: [
      { test: /\.js$/, loader: 'eslint' }
    ],
    loaders: [
      { test: /\.vue$/, loader: 'vue' },
      { test: /\.css$/, loader: 'style!css?modules' }
    ]
  },
  vue: {
    postcss: [
      require('autoprefixer')
    ]
  }
})

To

 {
  module: {
    rules: [
      { test: /\.js$/, loader: 'eslint-loader', enforce: 'pre' },
      { test: /\.vue$/, loader: 'vue-loader' },
      { test: /\.css$/, loader: 'style-loader!css-loader?modules' }
    ]
  },
  plugins: [
    new webpack.LoaderOptionsPlugin({
      options: {
        debug: true,
        vue: {
          postcss: [
            require('autoprefixer')
          ]
        }
      }
    })
  ]
}

Options

  • quiet
  • context

License

MIT

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code