Skip to content

Commit

Permalink
Remove caret & tilde
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegris committed May 21, 2017
1 parent d528a71 commit dd98155
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 86 deletions.
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

try {
const electron = require('electron');

// Module to control application life.
const { app } = electron;
// Module to create native browser window.
Expand All @@ -12,7 +13,8 @@ try {
serve = args.some(val => val === "--serve");

if (serve) {
require('electron-reload')(__dirname + '/dist');
require('electron-reload')(__dirname + '/dist', {
});
}

function createWindow() {
Expand Down Expand Up @@ -75,4 +77,5 @@ try {

} catch (e) {
// Catch Error
throw e;
}
114 changes: 57 additions & 57 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-electron",
"version": "1.3.5",
"version": "1.3.6",
"description": "Angular 4 with Electron (Typescript + SASS + Hot Reload)",
"homepage": "https://github.com/maximegris/angular-electron",
"author": {
Expand Down Expand Up @@ -35,67 +35,67 @@
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet"
},
"dependencies": {
"@angular/common": "~4.0.2",
"@angular/compiler": "~4.0.2",
"@angular/core": "~4.0.2",
"@angular/forms": "~4.0.2",
"@angular/http": "~4.0.2",
"@angular/platform-browser": "~4.0.2",
"@angular/platform-browser-dynamic": "~4.0.2",
"@angular/router": "~4.0.2",
"core-js": "~2.4.1",
"rxjs": "~5.3.0",
"zone.js": "~0.8.5"
"@angular/common": "4.0.2",
"@angular/compiler": "4.0.2",
"@angular/core": "4.0.2",
"@angular/forms": "4.0.2",
"@angular/http": "4.0.2",
"@angular/platform-browser": "4.0.2",
"@angular/platform-browser-dynamic": "4.0.2",
"@angular/router": "4.0.2",
"core-js": "2.4.1",
"rxjs": "5.3.0",
"zone.js": "0.8.5"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "~4.0.2",
"@types/electron": "~1.4.37",
"@angular/compiler-cli": "4.0.2",
"@types/electron": "1.4.37",
"@types/jasmine": "2.5.41",
"@types/node": "^7.0.18",
"autoprefixer": "~6.7.7",
"codelyzer": "~2.1.1",
"copyfiles": "~1.2.0",
"cross-env": "^4.0.0",
"css-loader": "~0.26.1",
"cssnano": "~3.10.0",
"electron": "~1.6.7",
"electron-packager": "~8.6.0",
"electron-reload": "~1.1.0",
"exports-loader": "~0.6.4",
"@types/node": "7.0.18",
"autoprefixer": "6.7.7",
"codelyzer": "2.1.1",
"copyfiles": "1.2.0",
"cross-env": "4.0.0",
"css-loader": "0.26.1",
"cssnano": "3.10.0",
"electron": "1.6.7",
"electron-packager": "8.6.0",
"electron-reload": "^1.2.0",
"exports-loader": "0.6.4",
"extract-zip": "=1.6.0",
"file-loader": "~0.11.1",
"html-loader": "~0.4.5",
"istanbul-instrumenter-loader": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"json-loader": "~0.5.4",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "~0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "~0.2.2",
"karma-sourcemap-loader": "~0.3.7",
"less-loader": "~2.2.3",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"postcss-loader": "~1.3.3",
"postcss-url": "~6.0.4",
"protractor": "~5.1.1",
"raw-loader": "~0.5.1",
"sass-loader": "~6.0.3",
"script-loader": "~0.7.0",
"source-map-loader": "~0.2.1",
"style-loader": "~0.16.1",
"stylus-loader": "~3.0.1",
"ts-node": "~3.0.2",
"tslint": "~5.1.0",
"typescript": "~2.2.2",
"url-loader": "~0.5.8",
"webdriver-manager": "~12.0.4",
"webpack": "~2.4.1",
"webpack-dev-server": "^2.4.5"
"file-loader": "0.11.1",
"html-loader": "0.4.5",
"istanbul-instrumenter-loader": "2.0.0",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"json-loader": "0.5.4",
"karma": "1.4.1",
"karma-chrome-launcher": "2.0.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "0.2.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-sourcemap-loader": "0.3.7",
"less-loader": "2.2.3",
"minimist": "1.2.0",
"mkdirp": "0.5.1",
"postcss-loader": "1.3.3",
"postcss-url": "6.0.4",
"protractor": "5.1.1",
"raw-loader": "0.5.1",
"sass-loader": "6.0.3",
"script-loader": "0.7.0",
"source-map-loader": "0.2.1",
"style-loader": "0.16.1",
"stylus-loader": "3.0.1",
"ts-node": "3.0.2",
"tslint": "5.1.0",
"typescript": "2.2.2",
"url-loader": "0.5.8",
"webdriver-manager": "12.0.4",
"webpack": "2.4.1",
"webpack-dev-server": "2.4.5"
},
"license": "SEE LICENSE IN LICENSE.md"
}
60 changes: 32 additions & 28 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { CommonsChunkPlugin, UglifyJsPlugin } = require('webpack').optimize;
const { AotPlugin } = require('@ngtools/webpack');

const nodeModules = path.join(process.cwd(), 'node_modules');
const entryPoints = ["inline","polyfills","sw-register","styles","vendor","main"];
const entryPoints = ["inline", "polyfills", "sw-register", "styles", "vendor", "main"];
const baseHref = "";
const deployUrl = "";

Expand Down Expand Up @@ -62,13 +62,13 @@ function getPlugins() {
let leftIndex = entryPoints.indexOf(left.names[0]);
let rightindex = entryPoints.indexOf(right.names[0]);
if (leftIndex > rightindex) {
return 1;
return 1;
}
else if (leftIndex < rightindex) {
return -1;
return -1;
}
else {
return 0;
return 0;
}
}
}));
Expand Down Expand Up @@ -98,26 +98,28 @@ function getPlugins() {
"options": {
"postcss": [
autoprefixer(),
postcssUrl({"url": (obj) => {
// Only convert root relative URLs, which CSS-Loader won't process into require().
if (!obj.url.startsWith('/') || obj.url.startsWith('//')) {
postcssUrl({
"url": (obj) => {
// Only convert root relative URLs, which CSS-Loader won't process into require().
if (!obj.url.startsWith('/') || obj.url.startsWith('//')) {
return obj.url;
}
if (deployUrl.match(/:\/\//)) {
}
if (deployUrl.match(/:\/\//)) {
// If deployUrl contains a scheme, ignore baseHref use deployUrl as is.
return `${deployUrl.replace(/\/$/, '')}${obj.url}`;
}
else if (baseHref.match(/:\/\//)) {
}
else if (baseHref.match(/:\/\//)) {
// If baseHref contains a scheme, include it as is.
return baseHref.replace(/\/$/, '') +
`/${deployUrl}/${obj.url}`.replace(/\/\/+/g, '/');
}
else {
`/${deployUrl}/${obj.url}`.replace(/\/\/+/g, '/');
}
else {
// Join together base-href, deploy-url and the original URL.
// Also dedupe multiple slashes into single ones.
return `/${baseHref}/${deployUrl}/${obj.url}`.replace(/\/\/+/g, '/');
}
}
}})
})
],
"sassLoader": {
"sourceMap": false,
Expand All @@ -130,7 +132,7 @@ function getPlugins() {
}
}));

if(isProd) {
if (isProd) {
plugins.push(new HashedModuleIdsPlugin({
"hashFunction": "md5",
"hashDigest": "base64",
Expand Down Expand Up @@ -158,7 +160,7 @@ function getPlugins() {
}));

} else {
plugins.push( new AotPlugin({
plugins.push(new AotPlugin({
"mainPath": "main.ts",
"hostReplacementPaths": {
"environments/index.ts": "environments/index.ts"
Expand Down Expand Up @@ -200,8 +202,8 @@ module.exports = {
"extensions": [
".ts",
".js",
".scss",
".json"
".scss",
".json"
],
"aliasFields": [],
"alias": { // WORKAROUND See. angular-cli/issues/5433
Expand Down Expand Up @@ -368,14 +370,16 @@ module.exports = {
},
"plugins": getPlugins(),
"node": {
"fs": "empty",
"global": true,
"crypto": "empty",
"tls": "empty",
"net": "empty",
"process": true,
"module": false,
"clearImmediate": false,
"setImmediate": false
fs: "empty",
global: true,
crypto: "empty",
tls: "empty",
net: "empty",
process: true,
module: false,
clearImmediate: false,
setImmediate: false,
__dirname: false,
__filename: false
}
};

0 comments on commit dd98155

Please sign in to comment.