Comments (6)
I think sourcemap support is important for the unbundled development flows specifically for things like Typescript where, even though it's not bundled, the source code you are typing is being transformed before it's sent to the browser. It's really not practical to debug the transpiled Javascript without sourcemaps.
from create-snowpack-app.
I modified the babel.config.json like this:
{
"extends": "@snowpack/app-scripts-react/babel.config.json",
"sourceMaps": "inline"
}
But the source maps are not in sync. If I add debugger;
command it is not on right line number.
In my opinion the source maps should be enabled by default when doing:
npx create-snowpack-app new-dir2 --template @snowpack/app-template-react-typescript
Why would the template exist if it didn't include the basic minimal setup? Source maps surely are one of the first things you need when debugging. (IMO the developer experience should be made so good that you can just debug from VSCode too, the ideal end-goal.)
from create-snowpack-app.
Yup, our sourcemap support is limited right now, due to the fact that they provide less value in unbundled development. See previous discussion here: https://www.pika.dev/npm/snowpack/discuss/221#comment-6691
Right now we don't really support source maps outside of the bundle step. The idea is that because each build is single-file, no one file is ever that different from its source.
We will eventually support this for those who still want it, and if anyone else is willing to own the implementation of this then I'd consider pushing it up the roadmap and tacking it now. But my time is limited, it's a hard problem to solve.
from create-snowpack-app.
since it's just the babel CLI, you can enable them by adding --source-maps
to the build script: https://babeljs.io/docs/en/babel-cli#compile-with-source-maps
Since your config gets merged with with the @snowpack/app-scripts-react
config, you would just define a script with the same name in your own snowpack.config.js
to overwrite the one provided by default.
from create-snowpack-app.
I think that we use the CLI because we needed to have the --config-file ${bundledConfig}
support. But, eventually the plugin should support this.
from create-snowpack-app.
Snowpack now handles JS/JSX/TS/JSX compilation internally, by default. You can still add Babel if you'd like (with or without --source-maps
) but CSA apps now ship without an additional Babel dependency by default.
from create-snowpack-app.
Related Issues (20)
- Babel Plugin import not working with snowpack HOT 1
- [webpack] Support non-SPA use-case HOT 1
- [plugin-webpack] Not compatible with [app-template-vue] HOT 1
- [plugin-webpack] Production builds: No bundle splitting based on `import(...)` directives HOT 9
- [plugin-svelte] Can not find App.css.js HOT 3
- Provide a blank template for Typescript HOT 4
- Feature request: Add pnpm as install option HOT 5
- Building is broken for Svelte HOT 5
- Add support for creating .gitignore from template HOT 5
- Can we have cli wizard prompts? HOT 6
- @snowpack/app-template-blank-typescript does not exist on NPM HOT 5
- onboard validations to ensure that the respective package manager is installed HOT 4
- plugin-dotenv doesn't work HOT 2
- [plugin-webpack] granular chunking for multi-page apps?
- [@snowpack/app-template-11ty] - HMR issue eleventy templates HOT 1
- Migrating Reactboilerplate app into CSA failing HOT 2
- [@snowpack/plugin-webpack] Use public path instead of baseUrl HOT 1
- [pnpm] missing dependencies in app-template-react-typescript (--use-pnpm) HOT 2
- svelte-typescript-template HOT 1
- Vue cannot use PostCSS in style tag. 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 create-snowpack-app.