Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

How to use babel plugins (dev only)? #83

Open
sookoll opened this issue Aug 4, 2017 · 1 comment
Open

How to use babel plugins (dev only)? #83

sookoll opened this issue Aug 4, 2017 · 1 comment

Comments

@sookoll
Copy link

sookoll commented Aug 4, 2017

I tried to use babel-plugin-wildcard. JSPM by default load babel and es6 modules into browser and then transpile. I guess that wildcard plugin needs to access file system to determine modules. So only option was server-side transpiling also in development mode.
Tried development bundling as described here: https://jspm.io/0.17-beta-guide/development-bundling.html with no luck.

$ jspm install --dev npm:babel-plugin-wildcard
SystemJS.config({
  ...
  meta: {
    '*.js': {
      babelOptions: {
        plugins: ['babel-plugin-wildcard']
      }
    }
  }
});

command to transpile bundle:

$ jspm bundle src/main.js src/build.js -id

It never recognize, that it should use wildcard plugin for transpile imports. Any quidance?

@aluanhaddad
Copy link

aluanhaddad commented Aug 15, 2017

The docs for that plugin show the name of the plugin as "wildcard" when passed to Babel.

Try this (untested):

$ jspm install --dev wildcard=npm:babel-plugin-wildcard

and in your configuration

SystemJS.config({
  meta: {
    '*.js': {
      babelOptions: {
        plugins: ['wildcard']
      }
    }
  }
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants