Transpile certain node_modules with Babel at Meteor-Build


#1

So I am currently building my first Meteor/Cordova hybrid app.
I would like to use framework7, but can’t get it to work, as it is not transpiled by default.
–> Meteor, React & F7 4.2.2 - Can’t import anything

Problem is, that I am totally confused on how to tell Meteor/Babel to also transpile certain node_modules.

The following code was extracted from a (working) example of framework7 from its webpack.config.js:

{
  test: /\.(js|jsx)$/,
  use: 'babel-loader',
  include: [
    resolvePath('src'),
    resolvePath('node_modules/framework7'),
    resolvePath('node_modules/framework7-react'),
    resolvePath('node_modules/template7'),
    resolvePath('node_modules/dom7'),
    resolvePath('node_modules/ssr-window'),
  ],
}

So I need the “Meteor/Babel” Version of this webpack config so the Meteor bundler also uses Babel for these 5 node_modules and transpiles them at build.

How do I do that?

Thanks, cheers, Patrick


#2

you can make a softlink (ln -s node_modules/framework7 imports/framework7) into your project. Meteor then will transpile these folders. maybe this works in your case