Giter Club home page Giter Club logo

webpack-require-http's People

Contributors

alikr avatar darkty2009 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

webpack-require-http's Issues

how to load url with params ?

thank you .

please help me .

webpack.config.js

    externals:[
        require('webpack-require-http')
    ]

this is code

const apiKey='xxxxxx';
require('http://codemirror.net/mode/javascript/javascript.js?ak='+apiKey); // has error
require('http://codemirror.net/mode/javascript/javascript.js?ak=xxxxxx'); //  is worked

this is error

Module not found: Error: Cannot resolve module 'http://codemirror.net' in /home/mx/learn/src/components/Node

What is the reason?

The level of vegetables, please...

No thenable exposed on require('http://..)

In the browser console I am getting the error

Cannot read property 'then' of undefined

I am trying to require from inside an angular router loadChildren. In this way I could load into a module from an entirely different project. Localhost here is just used for testing this idea.

const routes: Routes = [
    { path: ``, loadChildren: () => new Promise(function (resolve) {
        require('http://localhost:3100/testset-module-bundle.js').then((response: any) => {
          resolve(response)
        }
      )
      })
    }
];

I'm aware that wrapping it in another promise like that is kind of dumb, but it's just for test purposes so I have more control.

The bundled code output from webpack looks like:

var routes = [
    { path: "", loadChildren: function () { return new Promise(function (resolve) {
            __webpack_require__(406).then(function (response) {
                resolve(response);
            });
        }); }
    }
];

Assets requirement not ready

If anybody looks inside ext folder nowadays, will just see two javascript extension treatment files, for .js and .css required files; but, what happens with the rest of things we can import using webpack, such fonts, images or any other kind of assets?

I'm convinced webpack-require-http may add a treatment for assets in its code, in order to let it be imported through http and by-passing the import() function.

Hope this won't become a super-effort at all.

Thanks a lot fot this package.

protocol error

if(result.protocol == 'http:' || request.protocol == 'https:') {

correct:
if(result.protocol == 'http:' || result.protocol == 'https:') {

required file still is still being loaded

My code has a few requires of local files, but when i use this webpack-require-http , the external (http) file is still getting a call from the browser, even though it's in the bundle as well.
as my main objective is to reduce traffic. i need to remove the 'extra' call.
any idea why this is happening ?
Thanks

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.