the-couch / slater

🛠 Shopify development toolkit
https://slater.store/
348 stars 47 forks source link

Sourcemaps activation #91

Open jeremyvienney opened 4 years ago

jeremyvienney commented 4 years ago

Hello,

First thanks you for this build tool, it works very well and make forget the pain about the workflow around Shopify theme creation !

I'm trying to figure how to enable the sourcemaps in the pipeline. I assume that the file staler.config.js export an object that extend the webpack default build right ? So I tried to add this key which in Webpack should add sourcemaps to any bundled files :

module.exports = {
  devtool: 'source-map',

Unfortunatly it doesn't do anything.

Do you have any advice/recommandation about this ?

jeremyvienney commented 4 years ago

Well after a few hours digging further deep in the project, I figured that the slater.config.js do not extend any Webpack configuration. I tried some solutions about extend the config with a function into the presets key but it didn't work at all. This solution was for me the best, even if you don't want work with tailwind css this is for me the best solution as you have totally freedom about your css setup ! https://github.com/the-couch/slater/issues/14#issuecomment-495550256

With Laravel Mix, if you want enable the sourcemaps add simply this line to the mix()

.sourceMaps(true, 'inline-source-map')

I recommend to init this only for dev mode !