Comments (11)
Resolving this as the fix mentioned has since been implemented in another feature - https://github.com/babel/babel-loader/blob/master/index.js#L55-L57
from babel-loader.
Looks like 6to5-loader
finds out whether to include source maps or not via this line.
from babel-loader.
Yeah, I saw that, but I don't know how to set it. In my webpack.config.js
I have my loader options as:
loader: '6to5-loader?{"runtime":true,"modules":"common","blacklist":["react"],"sourceMaps":"false"}'
But that doesn't seem to work.
from babel-loader.
Webpack uses a querystring like style to pass options to loaders.
You should do something like:
loader: '6to5?runtime&modules=common&blacklist[]=react&!-sourcemap
You can find more info on how to use options with webpack loaders here: https://github.com/webpack/loader-utils
from babel-loader.
Uh. Took a deeper inspection (or better reading) and your way of passing options is fine. My bad.
However the sourceMap option should be singular not plural.
Still I need to take a better look to compare both source maps.
from babel-loader.
@Couto, using sourceMap or sourceMaps doesn't work. The suggested querystring style also doesn't work as given, and removing the "!" yields errors from the source-map module (I also tried with variations of case and plurality all with errors).
So far the only way I've found that works is to manually set options.sourceMap
to false in 6to5-loader, which is far from ideal.
from babel-loader.
yields errors from the source-map module
Our build servers just updated to webpack-core 0.5.0 (and its source-maps dependency) and this is breaking everything. Is there no way to set this.sourceMaps
from options ?
edit: it's not babel-loader which is breaking everything. but in my testing, this.sourceMap
is always true, no matter what webpack config options I try
edit: specified webpack-core
, not webpack
from babel-loader.
Not sure what the specific issue is so if someone can elaborate it'd be great. ie. why it's an issue and why webpack isn't supplying the correct sourceMap
option.
from babel-loader.
Also can you confirm your webpack version please? the current version of webpack is 1.7.2, so I find your version kinda odd.
from babel-loader.
It looks like babel-loader ignores any sourceMap options you pass in the 'loader' line, it just checks to see if webpack wants a sourceMap and forwards that option. Webpack sourcemaps are enabled with the devtool param (as you probably already know).
Maybe the right thing to do for this issue is to have the 'loader' sourceMap option override the global webpack option. e.g. changing
https://github.com/babel/babel-loader/blob/master/index.js#L31
to
if (options.sourceMap === undefined) options.sourceMap = this.sourceMap;
but keep in mind that turning on sourcemaps there won't work unless sourcemaps are turned on for webpack also.
from babel-loader.
@Rob-ot that fix solves my problem.
from babel-loader.
Related Issues (20)
- [Bug]: TypeError: this.getOptions is not a function + SPFx HOT 8
- @babel/plugin-transform-optional-chaining, configuration does not take effect HOT 1
- BunnyJs
- `module.exports` is returned instead of `module.exports.default` when importing from node_modules HOT 1
- Plugin transform-runtime generates incorrect commonjs wrapper HOT 2
- Issue while creating build for React JS Application HOT 6
- unknow option .default HOT 5
- Adding ES6 `import("find-cache-dir");` should be a breaking change. HOT 7
- You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | HOT 1
- [Bug]: HOT 2
- export default is not a function
- I am facing issue in opening my file in the browser by the live server extnsion HOT 1
- Babel-loader Cache - unable to cache in changing directory environment HOT 3
- After upgrade my nodejs version 16.8.0 to 16.9.0, I am getting this error "You may need an additional loader to handle the result of these loaders" HOT 1
- Bug Error Run npm ci npm ERR! Cannot read property '@babel/cli' of undefined npm ERR! HOT 1
- Feature request: Different browserslistEnv based on webpack target. HOT 1
- You may need additional loaders
- semver vulnerable to Regular Expression Denial of Service HOT 3
- Bump semver dependency to >= 7.5.2 HOT 1
- Vulnerable dependencies (indirect security issues) 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 babel-loader.