webpack - build browser-ready build and ES6
up vote
0
down vote
favorite
I have an ES6 project A that needs to be consumed by
- another webapp during runtime - it'll include the lib via
script
tag, and A then exposes a class/constructor in global (window
) namespace; - another program B as a build-time dependency.
First requirement is simple - that's our usual babel+webpack (or whatever bundler) usage to transpile it down to ES5 and bundle it up to be used in web.
What about second one? How to make this library also publishable (eg on a private npm server) so B can use the ES6 code, and transpile this themselves into whatever js is required.
This would give us the benefit of treeshaking when B is built.
Edit: not sure if it's important, but this is not for node runtime, only web.
webpack babeljs webpack-4 javascript-build
add a comment |
up vote
0
down vote
favorite
I have an ES6 project A that needs to be consumed by
- another webapp during runtime - it'll include the lib via
script
tag, and A then exposes a class/constructor in global (window
) namespace; - another program B as a build-time dependency.
First requirement is simple - that's our usual babel+webpack (or whatever bundler) usage to transpile it down to ES5 and bundle it up to be used in web.
What about second one? How to make this library also publishable (eg on a private npm server) so B can use the ES6 code, and transpile this themselves into whatever js is required.
This would give us the benefit of treeshaking when B is built.
Edit: not sure if it's important, but this is not for node runtime, only web.
webpack babeljs webpack-4 javascript-build
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have an ES6 project A that needs to be consumed by
- another webapp during runtime - it'll include the lib via
script
tag, and A then exposes a class/constructor in global (window
) namespace; - another program B as a build-time dependency.
First requirement is simple - that's our usual babel+webpack (or whatever bundler) usage to transpile it down to ES5 and bundle it up to be used in web.
What about second one? How to make this library also publishable (eg on a private npm server) so B can use the ES6 code, and transpile this themselves into whatever js is required.
This would give us the benefit of treeshaking when B is built.
Edit: not sure if it's important, but this is not for node runtime, only web.
webpack babeljs webpack-4 javascript-build
I have an ES6 project A that needs to be consumed by
- another webapp during runtime - it'll include the lib via
script
tag, and A then exposes a class/constructor in global (window
) namespace; - another program B as a build-time dependency.
First requirement is simple - that's our usual babel+webpack (or whatever bundler) usage to transpile it down to ES5 and bundle it up to be used in web.
What about second one? How to make this library also publishable (eg on a private npm server) so B can use the ES6 code, and transpile this themselves into whatever js is required.
This would give us the benefit of treeshaking when B is built.
Edit: not sure if it's important, but this is not for node runtime, only web.
webpack babeljs webpack-4 javascript-build
webpack babeljs webpack-4 javascript-build
edited Nov 7 at 13:28
asked Nov 7 at 13:20
basher
256
256
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f53190310%2fwebpack-build-browser-ready-build-and-es6%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