Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't resolve plugin paths in babel 6 #196

Closed
dschissler opened this issue Jan 7, 2016 · 10 comments
Closed

I can't resolve plugin paths in babel 6 #196

dschissler opened this issue Jan 7, 2016 · 10 comments

Comments

@dschissler
Copy link

I'm not sure if this is a babel or babel-loader issue. I can't resolve the plugin paths or preset paths. This is my project structure:

  • app
    • webpack
      • entries
      • commons
      • modules
  • dev
    • gulpfile.js
    • node_modules
    • bower_components
    • vendor
@dschissler
Copy link
Author

    loaders: [{
      test: /\.js?$/,
      loader: 'babel',
      exclude: /(node_modules|bower_components)/,
      query: {
        cacheDirectory: '/tmp',
        // plugins: ['transform-runtime'],
        presets: ['es2015', 'stage-0']
        // presets: [
        //   require('babel-preset-es2015'),
        //   require('babel-preset-stage-0')
        // ]
      }
    }, {

@bebraw
Copy link

bebraw commented Jan 9, 2016

Can you set up a standalone project to try out? Just tried a similar configuration without any hickups.

@dschissler
Copy link
Author

My proprietary project is based on my open source Webird system. I won't be able to play with that for a few weeks.

Here are some highlights from the webpack config. Notice that its using mostly absolute paths.

    context: webpackRoot,
    resolve: {
         root: [appModulesRoot, bowerRoot, nodeModulesRoot, themeRoot],
         modulesDirectories: [appModulesRoot, 'node_modules', 'bower_components'],
         ...
    },
    resolveLoader: {
        root: nodeModulesRoot
    },

@bebraw
Copy link

bebraw commented Jan 9, 2016

@dschissler I think #166 might be related to this. If you look that up, you can see a suggested hack (require.resolve each preset).

@dschissler
Copy link
Author

@bebraw thanks. I'm trying it again now.

@bebraw
Copy link

bebraw commented Jan 9, 2016

@dschissler Ok. If you think this is duplicate of #166, feel free to close.

@dschissler
Copy link
Author

It does appear to be a duplicate but now I'm working through some other issues. I'll probably close this once I figure it out.

@dschissler
Copy link
Author

@bebraw Now I'm having issues with the Bluebird Promise polyfill:

'use strict';
// import bluebird from 'bluebird';
import 'whatwg-fetch';

// Setup Bluebird Promise polyfill for Babel
if (!window.Promise) {
//  require('babel-runtime/core-js/promise').default = require('bluebird');
  require('babel-runtime/core-js/promise').default = require.resolve('bluebird');
}

I'm finally running JS on my front end though so safe to say its a dupe. Thanks.

@bebraw
Copy link

bebraw commented Jan 9, 2016

@dschissler Ok. Maybe someone in the Bluebird project has some idea about that. Hard to say what's wrong with that. No doubt something changed with Babel 6. 😄

@dschissler
Copy link
Author

@bebraw It is also breaking the gettext translation that I need for my nunjucks template. If I remove bluebird polyfill setup and the calls like {{ t('message') }} in my templates then it all works. That is pretty good. I suspect that they are related so I'll see if I can solve it.

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

No branches or pull requests

2 participants