Skip to content

QingWei-Li/2webpack2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🕳️ Turn configuration of webpack 1 to 2

Resources

License

Stars

Watchers

Forks

Packages

No packages published