jorgeorm / webpack-lib

This project aims to have a wide set of configurations that can be used across a wide set of projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support vue projects

jairovg opened this issue · comments

What problem does this feature solve?

  • Vue files are not supported to be loaded with the current js API.
  • JSX vue components are not supported to be loaded with the current js API.
  • Vue files might be reviewed by linters.

What does the proposed API look like?

webpack.config.js

// ...
const config = wpMerge([
  // Vue loader implementation
  javascript.loadVue();
  // Linters
  styles.stylelintPlugin({ files: '.src/**/*.(s?(a|c)ss|vue)' });
  javascrip.eslintPlugin({ files: '.src/**/*.{js,jsx,vue}' });
]);

Babel.config.js

// ...
module.exports = {
  // Presets required for JSX vue projects
  presets: presetVue(),
};

.eslintrc.js

// ...
module.exports = {
  // Default suggested extends and parser for vue project
  extends: ESLINT_VUE_EXTENDS,
  parser: ESLINT_VUE_PARSER,
};