Skip to content

Commit

Permalink
Optimize site build by removing sourcemaps (#67)
Browse files Browse the repository at this point in the history
* Optimize site build by removing sourcemaps

* Just strip external sourcemaps from site

...instead of preventing them from being emitted in the first place.
This allows our default package builds to still have source maps.
  • Loading branch information
themadcreator authored Nov 10, 2016
1 parent 352e5ea commit b6a8259
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion gulp/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = (gulp, plugins, blueprint) => {

const postcssOptions = {
to : blueprint.destPath(project, "dist.css"),
map: { inline: false },
};
const postcssPlugins = [
// inline all imports
Expand All @@ -79,7 +80,7 @@ module.exports = (gulp, plugins, blueprint) => {
.pipe(plugins.stripCssComments({ preserve: /^\*/ }))
.pipe(plugins.replace(/\n{3,}/g, "\n\n"))
// see https://github.com/floridoo/vinyl-sourcemaps-apply/issues/11#issuecomment-231220574
.pipe(plugins.sourcemaps.write(undefined, { sourceRoot: null }))
.pipe(plugins.sourcemaps.write(".", { sourceRoot: null }))
.pipe(blueprint.dest(project))
.pipe(plugins.connect.reload());
});
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"bootstrap": "lerna bootstrap",
"build:landing": "(cd packages/landing; npm run build)",
"build:gulp": "NODE_ENV='\"production\"' gulp build",
"build:site": "npm-run-all build:gulp build:landing copy:docs copy:landing",
"copy:docs": "cp -r packages/docs/dist docs/docs",
"copy:landing": "cp -r packages/landing/dist/* docs/.",
"build:site": "npm-run-all build:gulp build:landing clean:docs copy:docs copy:landing delete:doc-source-maps",
"clean:docs": "rm -rf docs && git checkout docs/CNAME",
"copy:docs": "cp -rf packages/docs/dist docs/docs",
"copy:landing": "cp -rf packages/landing/dist/* docs/.",
"delete:doc-source-maps" : "find docs -name '*.map' -type f -delete",
"serve": "http-server docs"
},
"dependencies": {
Expand Down

1 comment on commit b6a8259

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize site build by removing sourcemaps (#67)

Preview: docs | landing | table Coverage: core | datetime

Please sign in to comment.