You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you use the --sourcemap argument in the CLI to generate the CSS builds with sourcemaps, the sourceMappingURL in the CSS file will include the full file path which breaks the sourcemaps. This will make it impossible to use sourcemaps with projects that structure their files in the following manner where src directory is where the source code is stored, dist directory is where the builds/bundles are stored and package.json is stored in the root directory.
src/
dist/
package.json
In the code below, the builds are stored in the dist directory, while the CSS source code is stored in the src directory.
body {
background-color: red;
}
/*# sourceMappingURL=dist/my-package.css.map */
What I expected from the dist/my-package.css output. Instead of dist/my-package.css.map as a sourcemap file path, the sourcemap file path is my-package.css.map.
body {
background-color: red;
}
/*# sourceMappingURL=my-package.css.map */
This is caused by the CLI command in package.json...
The CLI command sets the output file path to dist/my-package.css. The dist/ file path is added to the sourcemap file path in the dist/my-package.css file...
/*# sourceMappingURL=dist/my-package.css.map */
The dist/ file path breaks the sourcemap since the my-package.css.map file is always in the same directory as the my-package.css file and therefore the source map file path should always be
/*# sourceMappingURL=my-package.css.map */
The text was updated successfully, but these errors were encountered:
When you use the
--sourcemap
argument in the CLI to generate the CSS builds with sourcemaps, thesourceMappingURL
in the CSS file will include the full file path which breaks the sourcemaps. This will make it impossible to use sourcemaps with projects that structure their files in the following manner wheresrc
directory is where the source code is stored,dist
directory is where the builds/bundles are stored and package.json is stored in the root directory.In the code below, the builds are stored in the dist directory, while the CSS source code is stored in the src directory.
This is my simple code to reproduce this...
bundle.css
demo.html
package.json
src/stylesheet.css
dist/my-package.css output
What I expected from the dist/my-package.css output. Instead of
dist/my-package.css.map
as a sourcemap file path, the sourcemap file path ismy-package.css.map
.This is caused by the CLI command in package.json...
The CLI command sets the output file path to
dist/my-package.css
. Thedist/
file path is added to the sourcemap file path in the dist/my-package.css file...The
dist/
file path breaks the sourcemap since the my-package.css.map file is always in the same directory as the my-package.css file and therefore the source map file path should always beThe text was updated successfully, but these errors were encountered: