Comments (3)
Seems that we set configFile: false
to disable babel to read external babel.config.js
from underreact.
@jingsam it is intentional not to compile non-standard Javascript (flow) in the node_modules. To get around this problem, you will have to manually compile mapbox-gl-style-spec
like this:
// underreact.config.js
module.exports = {
webpackConfigTransform: config => {
injectGlStyleSpecLoader(config);
return config;
}
};
function injectGlStyleSpecLoader(webpackConfig) {
const rulesOneOf = webpackConfig.module.rules.find(obj => obj.oneOf).oneOf;
// The first loader is the regular javascript loader
const myLoader = Object.assign({}, rulesOneOf[0], {
exclude: undefined,
include: new RegExp(
'^' +
path.resolve(
__dirname,
'node_modules/@mapbox/mapbox-gl-style-spec/(?!dist)'
)
)
});
rulesOneOf.unshift(myLoader);
}
from underreact.
@kepta Do you mean standard Javascript is the code that conform @mapbox/babel-preset-mapbox
? I think the standard one is just use default babel setting, no other preset.
I think when users specify compileNodeModules: []
option, they definitely want to compile there modules by their project wide babel config. Don't you think your solution to compile mapbox-gl-style-spec is not elegant?
from underreact.
Related Issues (20)
- Projects without a public directory or explicitly configured output directory fail with globbing error HOT 1
- Travis test failures
- Build fails, saying to update caniuse-lite and browserslist
- Missing json in sourcemaps
- Support mapbox-gl 2.0 HOT 5
- [Feature Request] add worker-loader support
- Future of the project HOT 1
- support usage with typescript
- Consider changing default output directory to _site
- Suggested browserslist value for modern sites
- The default value of `DEPLOY_ENV` is confusing HOT 1
- Svg React transform and CSS loader HOT 4
- Images not loading using default publicDirectory HOT 7
- Routing example is broken
- Basic example is broken HOT 1
- Audit Upgrades HOT 2
- Issues with NPM Link HOT 1
- Does it support Flow? HOT 2
- core-js warning
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 underreact.