Skip to content

Latest commit

 

History

History
49 lines (43 loc) · 1.22 KB

README.md

File metadata and controls

49 lines (43 loc) · 1.22 KB

vue-auto-import-loader

Build Status Version License

Auto import template / style / script for *.vue file.

Install

npm i -D vue-auto-import-loader

webpack config

{
  module: {
    rules: [
      {
        test: /\.vue$/,
        use: [
          {
            loader: 'vue-loader',
            options: {}  // vue-loader options
          },
          {
            loader: 'vue-auto-import-loader',
            options: {
              scoped: false,
              files: {  // relative to *.vue file path
                template: '[name].html',
                style: '[name].css',
                script: '[name].js'
              },
              langs: {
                template: 'html',
                style: 'css',
                script: 'js'
              }
            }
          }
        ]
      }
    ]
  }
}