Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Removed legacy leftovers. Fixed sourcemaps generation (fixes #69)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsebastien committed Dec 21, 2015
1 parent 9adc8af commit 8870e07
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 0.2.3
* fixed sourcemap generation issues (see #69)
* sourcemaps sometime require a browser refresh before actually working: this might be due to a related issue (timing issue?)
* removed legacy leftovers
* 0.2.2
* added an option to define whether the production HTML should be minified or not: minifyProductionHTML (true by default)
* Angular 2 does not support HTML minification anymore: https://github.com/dsebastien/modernWebDevBuild/issues/67
Expand Down
3 changes: 3 additions & 0 deletions UPGRADE.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Upgrade guide

## From 0.2.2 to 0.2.3
No modification mandatory with this release.

## From 0.2.1 to 0.2.2
If you are using Angular 2, you should set the minifyProductionHTML option to false (see changelog)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modern-web-dev-build",
"description": "Modern Web Development Build.",
"version": "0.2.2",
"version": "0.2.3",
"author": {
"name": "Sebastien Dubois",
"email": "[email protected]",
Expand Down
9 changes: 2 additions & 7 deletions src/gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ let globs = {
let files = {
any: "*",
packageJSON: folders.root + "/package.json",
appTypeScriptReferences: folders.typings + "/typescriptApp.d.ts",
libraryTypeScriptDefinitions: folders.typings + globs.scripts.typescript,
htaccess: folders.nodeModules + "/apache-server-configs/dist/.htaccess",
jspmConfigFile: folders.root + "/jspm.conf.js"
typeScriptDefinitions: folders.typings + globs.scripts.typescript
};

let webServerFolders = {
Expand Down Expand Up @@ -86,8 +83,7 @@ let javascript = {
let typescript = {
src: [
folders.app + globs.scripts.typescript,
files.libraryTypeScriptDefinitions, // reference to library .d.ts files
files.appTypeScriptReferences // reference to app.d.ts files
files.typeScriptDefinitions // reference to .d.ts files
],
srcAppOnly: [
folders.app + globs.scripts.typescript
Expand Down Expand Up @@ -134,7 +130,6 @@ let html = {
let copy = {
src: [
folders.app + globs.any,
files.htaccess,

// ignore stuff handled by the other tasks
utils.exclude(folders.app + globs.html),
Expand Down
2 changes: 1 addition & 1 deletion src/gulp/tasks/scripts-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ScriptsJavaScriptTaskLoader extends AbstractTaskLoader {

// Write sourcemaps: https://www.npmjs.com/package/gulp-sourcemaps
//.pipe($.sourcemaps.write()) // use "." to write the sourcemap to a separate file in the same dir
.pipe(sourcemaps.write({ // use "." to write the sourcemap to a separate file in the same dir
.pipe(sourcemaps.write(".", { // use "." to write the sourcemap to a separate file in the same dir
includeContent: false, // alternative: include the contents and remove sourceRoot. Avoids issues but prevents from editing the sources directly in the browser
sourceRoot: "/" // use an absolute path because we have scripts in different subpaths
}))
Expand Down
9 changes: 7 additions & 2 deletions src/gulp/tasks/scripts-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import config from "../config";
import sourcemaps from "gulp-sourcemaps";
import ts from "gulp-typescript";
import size from "gulp-size";
//import debug from "gulp-debug";

class ScriptsTypeScriptTaskLoader extends AbstractTaskLoader {
registerTask(gulp){
Expand All @@ -25,6 +26,8 @@ class ScriptsTypeScriptTaskLoader extends AbstractTaskLoader {
});

let tsResult = gulp.plumbedSrc(config.typescript.src) // handle errors nicely (i.e., without breaking watch)
// Display the files in the stream
//.pipe(debug({title: "Stream contents:", minimal: true}))
.pipe(sourcemaps.init())
.pipe(ts(
tsProject
Expand All @@ -35,8 +38,10 @@ class ScriptsTypeScriptTaskLoader extends AbstractTaskLoader {

return tsResult.js

.pipe(sourcemaps.write({ // use "." to write the sourcemap to a separate file in the same dir
// sourcemaps need to be written to separate files otherwise Babel freaks out (!)
// Display the files in the stream
//.pipe(debug({title: "Stream contents:", minimal: true}))

.pipe(sourcemaps.write(".", { // use "." to write the sourcemap to a separate file in the same dir
includeContent: false, // alternative: include the contents and remove sourceRoot. Avoids issues but prevents from editing the sources directly in the browser
sourceRoot: "/" // use an absolute path because we have scripts in different subpaths
}))
Expand Down
2 changes: 1 addition & 1 deletion src/gulp/tasks/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ServeTaskLoader extends AbstractTaskLoader {
},
server: {
baseDir: config.webServerFolders.dev,

//routes: alternative way to map content that is above the base dir
// fix for SPAs w/ BrowserSync & others: https://github.com/BrowserSync/browser-sync/issues/204
// reference: https://github.com/BrowserSync/browser-sync/issues/204
middleware: [
Expand Down
4 changes: 2 additions & 2 deletions src/gulp/tasks/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class StylesTaskLoader extends AbstractTaskLoader {
}))

// Write sourcemaps: https://www.npmjs.com/package/gulp-sourcemaps
.pipe(sourcemaps.write({ // use "." to write the sourcemap to a separate file in the same dir
.pipe(sourcemaps.write(".", { // use "." to write the sourcemap to a separate file in the same dir
includeContent: false, // alternative: include the contents and remove sourceRoot. Avoids issues but prevents from editing the sources directly in the browser
sourceRoot: "./" // use the file's folder as source root
sourceRoot: "/" // use an absolute path because we have scripts in different subpaths
}))

// Include vendor prefixes
Expand Down

0 comments on commit 8870e07

Please sign in to comment.