bundle-loader icon indicating copy to clipboard operation
bundle-loader copied to clipboard

named export is `undefined`

Open sam-rad opened this issue 8 years ago • 4 comments

When using loader's syntax I get undefined for named exports:

// Comey.js
const Dismissed = () => <div> :| </div>
const Career = () => <div> ;| </div>

export {
  Dismissed as default,
  Career
};


// main.js
import Dismissed, { Career } from 'bundle-loader?lazy!./Comey';

console.log(Dismissed); //  function (cb) { blah }
console.log(Career);  // `undefined`


// - "webpack":       "2.4.1",
// - "bundle-loader": "0.5.5",

sam-rad avatar May 10 '17 14:05 sam-rad

@snikobonyadrad Also when using require() ?

michael-ciniawsky avatar May 10 '17 15:05 michael-ciniawsky

Yes sir:

var Dismissed = require('bundle-loader?lazy!./Comey');

console.log(Dismissed);        // [function]
console.log(Dismissed.Career); // `undefined`

// versus

var Dismissed = require('./Comey');

console.log(Dismissed);        // [function]
console.log(Dismissed.Career); // [function]

sam-rad avatar May 10 '17 15:05 sam-rad

Your webpack.config.js and ideally a small test repo please :)

michael-ciniawsky avatar May 10 '17 15:05 michael-ciniawsky

Here you go webpack-bundle-loader-bug. If you have cloud9 account I can give you access there too. Thanks.

sam-rad avatar May 10 '17 16:05 sam-rad