Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Webpack configuration is ignored #4

Open
jmotes opened this issue Nov 30, 2018 · 5 comments
Open

Webpack configuration is ignored #4

jmotes opened this issue Nov 30, 2018 · 5 comments

Comments

@jmotes
Copy link

jmotes commented Nov 30, 2018

I'm needing to apply this to my webpack config to solve a problem with using FaunaDB in my functions:

node-formidable/formidable#337 (comment)

Chris Coyier did it this way in his React project, but I cannot seem to get it to work in my vue.config.js.

https://github.com/chriscoyier/netlify-faunadb-example/blob/master/webpack.config.js

Here's my vue.config.js with everything set up, but it seems as if it's completely ignored when building the function:

const webpack = require("webpack");

module.exports = {
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        "global.GENTLY": false
      })
    ],
    node: {
      __dirname: true,
    },
    resolve: {
      alias: {
        'inherits': 'inherits/inherits_browser.js',
        'superagent': 'superagent/lib/client',
        'emitter': 'component-emitter',
      }
    }
  }
}
@jmotes
Copy link
Author

jmotes commented Nov 30, 2018

@cruzdanilo is this what your pull request (#3) solves?

@jmotes jmotes changed the title How to override webpack defaults? (vue.config.js settings are ignored) Webpack configuration is ignored Nov 30, 2018
@swyxio
Copy link

swyxio commented Nov 30, 2018

cc @shortdiv

@cruzdanilo
Copy link
Contributor

@jmotes yes, it is.

@jmotes
Copy link
Author

jmotes commented Jan 5, 2019

@shortdiv if you could find time to review @cruzdanilo's pull request I will buy you a coffee 😄☕️.

@e0
Copy link

e0 commented Jan 9, 2019

I appreciate the #3 PR, but for this specific formidable problem I didn't manage to figure out how to override the global.GENTLY plugin using vue.config.js.

I ended up forking the node-formidable package and removed all the if (global.GENTLY) require = GENTLY.hijack(require); lines which are causing the problems and perfectly safe to remove from what I can see. Then as I'm using yarn I could enforce this forked nested dependency in package.json like so:

...
 "dependencies": {
   ...
   "formidable": "https://github.com/e0/node-formidable",
   ...
 },
 "resolutions": {
   "formidable": "https://github.com/e0/node-formidable"
 },
...

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

4 participants