Giter Site home page Giter Site logo

async-module-loader's People

Contributors

fernandoacorreia avatar gaearon avatar nekr avatar nickdima avatar shama avatar sokra avatar zxcabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

async-module-loader's Issues

Bug with AsyncModulePlugin?

I was trying to use this loader, but encountered this issue: webpack-contrib#17

I have a work around (caching if the module loaded myself), but after debugging, its this plugin that causes the constant refetching, presumably because you want retries after failures. Is it possible to not cause a refetch if the bundle is present?

Also, could you explain the memory leak this helps prevent?

Thanks!

how to load the cdn file use the loader

i want use the loader load the remote file
require('async-module!http://xx.min.js')(function onLoad(mod) { console.log(mod) // mod.doSomething(); }, function onError() { });
it's not working .

Always failing

I'm using your fork in a project. It's just what I needed, thanks for this.

But I'm having an issue, I'm always hitting the fail callback. Do the number of modules that return matter or something?

When I do this:

require.ensure(['layouts/admin/admin-layout'], function(require) {
    var component = require('layouts/admin/admin-layout');
    console.log(component);
}, 'admin');

I get what I expect, the exports object. But when I do this:

require('async-module?name=admin!layouts/admin/admin-layout')(

    function success(component) {
        console.log('success');
    },

    function fail() {
        console.log('fail');
    }

);

I always get the fail.

This is my webpack.config:

var webpack = require('webpack');
var StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
var AsyncModulePlugin = require('async-module-loader/plugin');

var plugins = [
    new AsyncModulePlugin(),
    new StatsWriterPlugin({
        fields: null
    })
];

// if (process.env.NODE_ENV === 'production' && !Meteor.isCordova) {
//   plugins.push(new webpack.optimize.CommonsChunkPlugin('common', 'common.web.js'));
// }

module.exports = {
    entry: './entry',
    plugins: plugins,
    output: {
        chunkFilename: '[name]-[id].non-entry-chunk.web.js'
    },
    module: {
        loaders: [
            { test: /\.jade/, loader: 'template-html-loader' }
        ]
    }
};

Also, the network tab in chrome shows that the chunk was requested, and the response is 200 OK, with this contents (no whitespace above or below), in both scenarios. I repeat, same response in both scenarios. That's what's killing me:

webpackJsonp([1],{

/***/ 96:
/***/ function(module, exports, __webpack_require__) {

    /**
     * Admin Layout
     *
     * Default markup shared by all admin entry points
     */

    //===== STYLE ================================================================



    //===== JS ===================================================================



    //===== DEFINE COMPONENT =====================================================

    module.exports = MD.Vue.extend({
        template: __webpack_require__(97)
    });


/***/ },

/***/ 97:
/***/ function(module, exports) {

    module.exports = "<div class=\"admin-layout\"><p>This works as the layout for the admin stuff</p><router-view><p>this is content that can be accessed in the routed\ncomponent through the slot tag</p></router-view></div>"

/***/ }

});
//# sourceMappingURL=admin-1.non-entry-chunk.web.js.map

I don't really know if this is expecte behaviour and I just don't get what bundle-loader should be doing, or there's some legitimate issue going on.

Hope it's something small. Again, thanks for your fork, really nice.

Webpack 2 support

Method require.ensure in webpack 2.1.0-beta.25 now return a Promise, so with this loader i get exception: Uncaught TypeError: Cannot read property 'catch' of undefined

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.