From 0eefaa82e430c2be5027b08b826ea056e769a404 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Sat, 13 Feb 2016 13:50:19 +0100 Subject: [PATCH] Used path.join to join paths correctly (fixes #96) --- CHANGELOG.MD | 6 ++++-- UPGRADE.MD | 12 ++++++++++++ package.json | 2 +- src/gulp/config.js | 49 +++++++++++++++++++++++----------------------- 4 files changed, 42 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 7a129aa..96a76ea 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,7 @@ -* 0.3.3 - * ... +* 0.4.0 + * fixed an issue with production styles bundle (fixes #96) + * upgraded babel dependencies + * check the [upgrade](UPGRADE.MD) notes to know what you need to change * 0.3.2 * Fixed production bundles paths (css, js) (fixes #91) * 0.3.1 diff --git a/UPGRADE.MD b/UPGRADE.MD index 76083ca..c9fe1c8 100644 --- a/UPGRADE.MD +++ b/UPGRADE.MD @@ -1,5 +1,17 @@ # Upgrade guide +## From 0.3.2 to 0.4.0 +The way we construct the dist vendor css bundle has changed. +In your vendor.scss file, if you import third party stylesheets from jspm_packages or from node_modules, then you'll need to change the relative path. +Assuming that you have the same file structure as described in the [readme](README.md), then the import should look like this: + +``` +@import '../../jspm_packages/github/necolas/normalize.css@3.0.3/normalize.css'; // the path refers to the file at BUILD time +``` + +## From 0.3.1 to 0.3.2 +No modification mandatory with this release. + ## From 0.3.0 to 0.3.1 No modification mandatory with this release. diff --git a/package.json b/package.json index 6cd15e5..f67f9ae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "modern-web-dev-build", "description": "Modern Web Development Build.", - "version": "0.3.3", + "version": "0.4.0", "author": { "name": "Sebastien Dubois", "email": "seb@dsebastien.net", diff --git a/src/gulp/config.js b/src/gulp/config.js index 71bc090..099dcdc 100644 --- a/src/gulp/config.js +++ b/src/gulp/config.js @@ -1,6 +1,7 @@ "use strict"; import utils from "./utils"; +import path from "path"; let extensions = { javascript: ".js", @@ -38,17 +39,17 @@ let globs = { styles: { css: "/**/*" + extensions.css, sass: "/**/*" + extensions.sass, - vendor: folders.styles + "/vendor" + "{" + extensions.sass + "," + extensions.css + "}" + vendor: path.join(folders.styles, "/vendor" + "{" + extensions.sass + "," + extensions.css + "}") }, - images: folders.images + "/**/*" + "{" + extensions.png + "," + extensions.jpg + "," + extensions.jpeg + "," + extensions.gif + "," + extensions.svg + "}", + images: path.join(folders.images, "/**/*" + "{" + extensions.png + "," + extensions.jpg + "," + extensions.jpeg + "," + extensions.gif + "," + extensions.svg + "}"), html: "/**/*" + extensions.html, sourcemaps: "/**/*" + extensions.sourcemap }; let files = { any: "*", - packageJSON: folders.root + "/package.json", - typeScriptDefinitions: folders.typings + globs.scripts.typescript, + packageJSON: path.join(folders.root, "/package.json"), + typeScriptDefinitions: path.join(folders.typings, globs.scripts.typescript), systemjsConfigDefault: "jspm.conf.js" }; @@ -73,17 +74,17 @@ let finalJsBundleName = "bundle.min.js"; let javascript = { src: [ - folders.app + globs.scripts.javascript + path.join(folders.app, globs.scripts.javascript) ], - srcDist: folders.temp + "/core/boot.js", + srcDist: path.join(folders.temp, "/core/boot.js"), dest: folders.temp, - destDist: folders.dist + "/" + finalJsBundleName, + destDist: path.join(folders.dist, "/" + finalJsBundleName), finalJsBundlePath: finalJsBundleName }; let typescript = { srcAppOnly: [ - folders.app + globs.scripts.typescript + path.join(folders.app, globs.scripts.typescript) ], dest: folders.temp // JavaScript code is emitted in the temp folder }; @@ -93,19 +94,19 @@ let finalCSSVendorBundleName = "vendor.min.css"; let styles = { src: [ - folders.app + globs.styles.css, - folders.app + globs.styles.sass + path.join(folders.app, globs.styles.css), + path.join(folders.app, globs.styles.sass) ], srcVendorOnly: [ - folders.app + globs.styles.vendor + path.join(folders.app, globs.styles.vendor) ], srcWithoutVendor: [ - folders.app + globs.styles.css, - folders.app + globs.styles.sass, - utils.exclude(folders.app + globs.styles.vendor) + path.join(folders.app, globs.styles.css), + path.join(folders.app, globs.styles.sass), + utils.exclude(path.join(folders.app, globs.styles.vendor)) ], dest: folders.temp, // for DEV - destFiles: folders.temp + globs.styles.css, // for DEV + destFiles: path.join(folders.temp, globs.styles.css), // for DEV destDist: folders.dist, // for PROD finalCssBundleFilename: finalCSSBundleName, finalCssBundlePath: finalCSSBundleName, @@ -115,28 +116,28 @@ let styles = { let images = { src: [ - folders.app + globs.images + path.join(folders.app, globs.images) ], - dest: folders.dist + folders.images + dest: path.join(folders.dist, folders.images) }; let html = { src: [ - folders.app + globs.html + path.join(folders.app, globs.html) ], dest: folders.dist }; let copy = { src: [ - folders.app + globs.any, + path.join(folders.app, globs.any), // ignore stuff handled by the other tasks - utils.exclude(folders.app + globs.html), - utils.exclude(folders.app + globs.styles.css), - utils.exclude(folders.app + globs.styles.sass), - utils.exclude(folders.app + globs.scripts.javascript), - utils.exclude(folders.app + globs.scripts.typescript) + utils.exclude(path.join(folders.app, globs.html)), + utils.exclude(path.join(folders.app, globs.styles.css)), + utils.exclude(path.join(folders.app, globs.styles.sass)), + utils.exclude(path.join(folders.app, globs.scripts.javascript)), + utils.exclude(path.join(folders.app, globs.scripts.typescript)) ], dest: folders.dist };