Why use Webpack to bundle applications that run in node environment2019 Community Moderator ElectionHow to include a few node_modules package in babel-nodeHow to bundle node modules with native addons using webpack in node-webkit?NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. WebpackRunning a node express server using webpack-dev-serverNode Webpack not recognizing “Import”Error using ES7 async/await with node, webpack and babel-loaderWebpack bundle increased in size after converting to ES2015/ES6 modulesModule not found in webpack bundle, but it IS in the bundleWhy do we use ES6 modules for import in frontend frameworks instead of CommonJSNode - Fails to run Webpack bundlesCan't get babel-loader to add polyfill for String.prototype.trimLeft() (aka trimStart)
What has been your most complicated TikZ drawing?
Can infringement of a trademark be pursued for using a company's name in a sentence?
Why don't MCU characters ever seem to have language issues?
validation vs test vs training accuracy, which one to compare for claiming overfit?
My story is written in English, but is set in my home country. What language should I use for the dialogue?
Straight line with arrows and dots
Does Linux have system calls to access all the features of the file systems it supports?
Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?
How do anti-virus programs start at Windows boot?
Good allowance savings plan?
Does splitting a potentially monolithic application into several smaller ones help prevent bugs?
The three point beverage
Gravity alteration as extermination tool viable?
Heap & Stack Java
Best approach to update all entries in a list that is paginated?
Is it illegal in Germany to take sick leave if you caused your own illness with food?
Running a subshell from the middle of the current command
Why doesn't the EU now just force the UK to choose between referendum and no-deal?
Want to switch to tankless, but can I use my existing wiring?
Who is our nearest neighbor
Is "history" a male-biased word ("his+story")?
Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?
Fourth person (in Slavey language)
Rejected in 4th interview round citing insufficient years of experience
Why use Webpack to bundle applications that run in node environment
2019 Community Moderator ElectionHow to include a few node_modules package in babel-nodeHow to bundle node modules with native addons using webpack in node-webkit?NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. WebpackRunning a node express server using webpack-dev-serverNode Webpack not recognizing “Import”Error using ES7 async/await with node, webpack and babel-loaderWebpack bundle increased in size after converting to ES2015/ES6 modulesModule not found in webpack bundle, but it IS in the bundleWhy do we use ES6 modules for import in frontend frameworks instead of CommonJSNode - Fails to run Webpack bundlesCan't get babel-loader to add polyfill for String.prototype.trimLeft() (aka trimStart)
For me, Webpack is a bundler for "web" since browsers don't have good support for js module system. Thus using Webpack we could still use "module" way to develop and pack them for browsers.
Webpack has a config option target
module.exports =
target: 'node'
;
using
nodewebpack will compile for usage in a Node.js-like environment
But NodeJS already support CommonJS modules, why need Webpack to build something that runs in NodeJS environment?
Besides, if you want to compile your javascript, for example, using the ES module, you could just use babel to do so, using es module transform plugins or proper presets.
Why use Webpack, set the target to node and then use babel loader... instead of using babel directly?
I cannot think of the use case of using Webpack to bundle application running in node.
javascript node.js webpack babel
add a comment |
For me, Webpack is a bundler for "web" since browsers don't have good support for js module system. Thus using Webpack we could still use "module" way to develop and pack them for browsers.
Webpack has a config option target
module.exports =
target: 'node'
;
using
nodewebpack will compile for usage in a Node.js-like environment
But NodeJS already support CommonJS modules, why need Webpack to build something that runs in NodeJS environment?
Besides, if you want to compile your javascript, for example, using the ES module, you could just use babel to do so, using es module transform plugins or proper presets.
Why use Webpack, set the target to node and then use babel loader... instead of using babel directly?
I cannot think of the use case of using Webpack to bundle application running in node.
javascript node.js webpack babel
Webpack is sure a bundler but has support for many different use cases like parsing files, hashing parts and so on through plugins which is useful and readable.
– binariedMe
Mar 7 at 9:49
A good example is universal app that already uses Webpack to run in browser and uses its specific features (aliases, loaders, etc). In order to run it in Node it needs to be bundled with Webpack, too.
– estus
Mar 7 at 10:45
add a comment |
For me, Webpack is a bundler for "web" since browsers don't have good support for js module system. Thus using Webpack we could still use "module" way to develop and pack them for browsers.
Webpack has a config option target
module.exports =
target: 'node'
;
using
nodewebpack will compile for usage in a Node.js-like environment
But NodeJS already support CommonJS modules, why need Webpack to build something that runs in NodeJS environment?
Besides, if you want to compile your javascript, for example, using the ES module, you could just use babel to do so, using es module transform plugins or proper presets.
Why use Webpack, set the target to node and then use babel loader... instead of using babel directly?
I cannot think of the use case of using Webpack to bundle application running in node.
javascript node.js webpack babel
For me, Webpack is a bundler for "web" since browsers don't have good support for js module system. Thus using Webpack we could still use "module" way to develop and pack them for browsers.
Webpack has a config option target
module.exports =
target: 'node'
;
using
nodewebpack will compile for usage in a Node.js-like environment
But NodeJS already support CommonJS modules, why need Webpack to build something that runs in NodeJS environment?
Besides, if you want to compile your javascript, for example, using the ES module, you could just use babel to do so, using es module transform plugins or proper presets.
Why use Webpack, set the target to node and then use babel loader... instead of using babel directly?
I cannot think of the use case of using Webpack to bundle application running in node.
javascript node.js webpack babel
javascript node.js webpack babel
asked Mar 7 at 9:46
Timothy LeeTimothy Lee
469212
469212
Webpack is sure a bundler but has support for many different use cases like parsing files, hashing parts and so on through plugins which is useful and readable.
– binariedMe
Mar 7 at 9:49
A good example is universal app that already uses Webpack to run in browser and uses its specific features (aliases, loaders, etc). In order to run it in Node it needs to be bundled with Webpack, too.
– estus
Mar 7 at 10:45
add a comment |
Webpack is sure a bundler but has support for many different use cases like parsing files, hashing parts and so on through plugins which is useful and readable.
– binariedMe
Mar 7 at 9:49
A good example is universal app that already uses Webpack to run in browser and uses its specific features (aliases, loaders, etc). In order to run it in Node it needs to be bundled with Webpack, too.
– estus
Mar 7 at 10:45
Webpack is sure a bundler but has support for many different use cases like parsing files, hashing parts and so on through plugins which is useful and readable.
– binariedMe
Mar 7 at 9:49
Webpack is sure a bundler but has support for many different use cases like parsing files, hashing parts and so on through plugins which is useful and readable.
– binariedMe
Mar 7 at 9:49
A good example is universal app that already uses Webpack to run in browser and uses its specific features (aliases, loaders, etc). In order to run it in Node it needs to be bundled with Webpack, too.
– estus
Mar 7 at 10:45
A good example is universal app that already uses Webpack to run in browser and uses its specific features (aliases, loaders, etc). In order to run it in Node it needs to be bundled with Webpack, too.
– estus
Mar 7 at 10:45
add a comment |
1 Answer
1
active
oldest
votes
One reason I can think of when to use webpack for node is when you have a node_modules package where it's not compiled yet (Still in ES6).
babel-node won't be able to help you bundle the node_modules packages that need to be transpiled along with the rest of your code
I had to go through this process.. ): This scenario is helpful in Yarn Workspaces where you want your server to depend on another package in your workspace. Where your server will re-update whenever you make changes in the other package with the help of webpack
How to include a few node_modules package in babel-node
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55040635%2fwhy-use-webpack-to-bundle-applications-that-run-in-node-environment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
One reason I can think of when to use webpack for node is when you have a node_modules package where it's not compiled yet (Still in ES6).
babel-node won't be able to help you bundle the node_modules packages that need to be transpiled along with the rest of your code
I had to go through this process.. ): This scenario is helpful in Yarn Workspaces where you want your server to depend on another package in your workspace. Where your server will re-update whenever you make changes in the other package with the help of webpack
How to include a few node_modules package in babel-node
add a comment |
One reason I can think of when to use webpack for node is when you have a node_modules package where it's not compiled yet (Still in ES6).
babel-node won't be able to help you bundle the node_modules packages that need to be transpiled along with the rest of your code
I had to go through this process.. ): This scenario is helpful in Yarn Workspaces where you want your server to depend on another package in your workspace. Where your server will re-update whenever you make changes in the other package with the help of webpack
How to include a few node_modules package in babel-node
add a comment |
One reason I can think of when to use webpack for node is when you have a node_modules package where it's not compiled yet (Still in ES6).
babel-node won't be able to help you bundle the node_modules packages that need to be transpiled along with the rest of your code
I had to go through this process.. ): This scenario is helpful in Yarn Workspaces where you want your server to depend on another package in your workspace. Where your server will re-update whenever you make changes in the other package with the help of webpack
How to include a few node_modules package in babel-node
One reason I can think of when to use webpack for node is when you have a node_modules package where it's not compiled yet (Still in ES6).
babel-node won't be able to help you bundle the node_modules packages that need to be transpiled along with the rest of your code
I had to go through this process.. ): This scenario is helpful in Yarn Workspaces where you want your server to depend on another package in your workspace. Where your server will re-update whenever you make changes in the other package with the help of webpack
How to include a few node_modules package in babel-node
answered Mar 7 at 9:59
Kenneth TruongKenneth Truong
1,7251027
1,7251027
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55040635%2fwhy-use-webpack-to-bundle-applications-that-run-in-node-environment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Webpack is sure a bundler but has support for many different use cases like parsing files, hashing parts and so on through plugins which is useful and readable.
– binariedMe
Mar 7 at 9:49
A good example is universal app that already uses Webpack to run in browser and uses its specific features (aliases, loaders, etc). In order to run it in Node it needs to be bundled with Webpack, too.
– estus
Mar 7 at 10:45