Giter VIP home page Giter VIP logo

Comments (6)

barraponto avatar barraponto commented on June 3, 2024 3

Got a package published today for vue support: https://www.npmjs.com/package/neutrino-preset-vue

from neutrino.

eliperelman avatar eliperelman commented on June 3, 2024 2

That's awesome! I'm going to go ahead and close this, and recommend that Vue users check out your preset. Thanks!

from neutrino.

eliperelman avatar eliperelman commented on June 3, 2024 1

EDIT: Just realized that you hadn't previously defined the Vue loader. The first parameter to .loader is the ID of the loader, then the actual loader used. Try this:

config.module
    .rule('compile')
    .test(/\.vue?$/)
    .loader('vue', require.resolve('vue-loader'));

By adding a new loader, there are no options passed to the function. You should only use the function when you need to override something already in place. Also, I don't see merge defined in this scope. Also, switching the .test to /\.vue?$/ in the compile rule means Babel will only compile files with that extension, is that desired?

If the vue-loader doesn't need any options, consider writing it like this:

config.module
  .rule('compile')
  .test(/\.vue?$/)
  .loader('vue-loader', require.resolve('vue-loader'));

from neutrino.

eliperelman avatar eliperelman commented on June 3, 2024

@suhaotian Thank you! Unfortunately, I myself am not qualified to create a Vue preset, but would gladly promote it if someone created one.

from neutrino.

eliperelman avatar eliperelman commented on June 3, 2024

Looks like there might be some resources here to at least get a first draft of a Vue preset going:

https://vuejs.org/v2/guide/single-file-components.html

from neutrino.

suhaotian avatar suhaotian commented on June 3, 2024
'use strict';

const web = require('neutrino-preset-web');
const webpack = require('webpack');


module.exports = neutrino => {
  web(neutrino);

  const { config } = neutrino;

  config.module
    .rule('compile')
    .test(/\.vue?$/)
    .loader('vue-loader', ({ options }) => {
      return {
        options: merge(options, {})
      };
    });
};

I try this, but didn't work...

from neutrino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.