Skip to content

Instantly share code, notes, and snippets.

@bocharsky-bw
Forked from plfort/webpack.config.js
Created January 5, 2018 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bocharsky-bw/4f57c51d029bd6df4371000e9085a702 to your computer and use it in GitHub Desktop.
Save bocharsky-bw/4f57c51d029bd6df4371000e9085a702 to your computer and use it in GitHub Desktop.
Symfony Encore trick for completion in PHPStorm (Can't analyse webpack.config.js)
...
let config = Encore.getWebpackConfig();
if(!Encore.isProduction()) {
fs.writeFile("fakewebpack.config.js", "module.exports = "+JSON.stringify(config), function(err) {
if(err) {
return console.log(err);
}
console.log("fakewebpack.config.js written");
});
}
module.exports = config;
// Then in PhpStorm webpack settings, point to the fakewebpack.config.js file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment