/vue-import-loader

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Vue Import Loader

Travis Build Average time to resolve an issue Percentage of issues still open FOSSA Status

Vue.js component pre-loader for Webpack

Description

In vue file, this loader create a new way to import your components.

// From this
...'path/to/your/component.vue'

// To this
'component-': () => import('path/to/your/component.vue')

Usage

Install Package

  • Install Packge via Github

npm install phamhongphuc/vue-import-loader

  • Add vue-import-loader after vue-loader in webpack config
module.exports = {
  // More config
  module: {
    rules: [
      {
        test: /\.vue$/,
        use: [
          {
            loader: "vue-loader",
            query: {
              presets: ["es2015", "stage-2"]
            }
          },
          {
            loader: "vue-import-loader"
          }
        ]
      }
    ]
  }
};

😎 Happy Coding 😎

License

FOSSA Status