Comments (7)
IMO the only problem is that babel-loader
might slow down the compile phase of your project.
If b2a
or every other javascript library compiles the module entry to target ie 11, and if somebody has a project which should be compatible with ie8, he still needs the babel-loader
.
Then maybe another guy creates a project that only works for chrome, the polyfills(and ponyfills) of b2a
for ie11 are completely unnecessary for him and also bad for performance.
So, I'd like not to compile the module entry of any library unless it contains some syntaxes which are not of ECMA standards.
from b2a.
I think we can use babel-loader
for webpack.
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
}
from b2a.
@kaelzhang do you mean add this to our codebase? That's actually one of workarounds I was thinking about. But for me it seems a bit odd to transpile dependencies.
from b2a.
@kaelzhang gotcha. Thanks for answering, will stick with adding babel configuration!
from b2a.
Thanks for your understanding 😄
from b2a.
By the way, I was always thinking that main property in package.json is treated as module root. But that's not the truth (and also there is file lib/index.js that contains transpiled and IE compatible code, what's the purpose of it then?)
from b2a.
The main
field of package.json indicates the entry for nodejs. And for most scenarios, we should not rely on babel(babel-node for example) to run a node application.
from b2a.
Related Issues (2)
- Nice work! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from b2a.