Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NativeScript/nativescript-dev-webpack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.9.0
Choose a base ref
...
head repository: NativeScript/nativescript-dev-webpack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.9.1
Choose a head ref
  • 8 commits
  • 8 files changed
  • 2 contributors

Commits on Dec 22, 2017

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5a40330 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eeb1b8e View commit details

Commits on Jan 2, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a37cca0 View commit details

Commits on Jan 9, 2018

  1. fix: support aot on windows (#392)

    The compile host seems to use forward instead of backward slashes on windows.
    PanayotCankov authored and sis0k0 committed Jan 9, 2018
    Copy the full SHA
    8a20502 View commit details
  2. fix(css): disable minification when using uglify (#383)

    * fix(css): disable minification when using uglify
    
    related to #154, #135
    fixes #377
    
    * refactor: inline css-loader options
    sis0k0 authored Jan 9, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8e1a5a6 View commit details

Commits on Jan 10, 2018

  1. feat: use UglifyJsPlugin which support es6 code (#401)

    * chore: add uglifyjs-webpack-plugin to project devDeps
    
    * refactor: update webpack templates to use UglifyJsPlugin
    sis0k0 authored Jan 10, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    34b1b9d View commit details
  2. release: cut the 0.9.1 release

    sis0k0 committed Jan 10, 2018
    Copy the full SHA
    07ba1ae View commit details
  3. docs: add changelog for 0.9.1

    sis0k0 committed Jan 10, 2018
    Copy the full SHA
    e423ddb View commit details
Showing with 111 additions and 44 deletions.
  1. +20 −0 CHANGELOG.md
  2. +16 −16 demo/AngularApp/package.json
  3. +14 −8 dependencyManager.js
  4. +2 −2 package.json
  5. +1 −0 plugins/NativeScriptAngularCompilerPlugin.ts
  6. +22 −7 templates/webpack.angular.js
  7. +18 −5 templates/webpack.javascript.js
  8. +18 −6 templates/webpack.typescript.js
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
<a name="0.9.1"></a>
## [0.9.1](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.9.0...0.9.1) (2018-01-10)


### Bug Fixes

* respect windows paths in /app.css regex ([#385](https://github.com/NativeScript/nativescript-dev-webpack/issues/385)) ([a37cca0](https://github.com/NativeScript/nativescript-dev-webpack/commit/a37cca0))
* support aot on windows ([#392](https://github.com/NativeScript/nativescript-dev-webpack/issues/392)) ([8a20502](https://github.com/NativeScript/nativescript-dev-webpack/commit/8a20502))
* **css:** disable minification when using uglify ([#383](https://github.com/NativeScript/nativescript-dev-webpack/issues/383)) ([8e1a5a6](https://github.com/NativeScript/nativescript-dev-webpack/commit/8e1a5a6)), closes [#377](https://github.com/NativeScript/nativescript-dev-webpack/issues/377)


### Features

* support for Angular 5.1 ([#374](https://github.com/NativeScript/nativescript-dev-webpack/issues/374)) ([5a40330](https://github.com/NativeScript/nativescript-dev-webpack/commit/5a40330))
* use UglifyJsPlugin which support es6 code ([#401](https://github.com/NativeScript/nativescript-dev-webpack/issues/401)) ([34b1b9d](https://github.com/NativeScript/nativescript-dev-webpack/commit/34b1b9d))



<a name="0.9.0"></a>
# [0.9.0](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.8.0...v0.9.0) (2017-12-20)

> You can follow the [Migration guide](https://www.nativescript.org/blog/nativescript-webpack-0.9.0-what-changed-and-how-to-upgrade) for upgrading to this version.

### Bug Fixes

32 changes: 16 additions & 16 deletions demo/AngularApp/package.json
Original file line number Diff line number Diff line change
@@ -13,14 +13,14 @@
}
},
"dependencies": {
"@angular/common": "~5.0.0",
"@angular/compiler": "~5.0.0",
"@angular/core": "~5.0.0",
"@angular/forms": "~5.0.0",
"@angular/http": "~5.0.0",
"@angular/platform-browser": "~5.0.0",
"@angular/platform-browser-dynamic": "~5.0.0",
"@angular/router": "~5.0.0",
"@angular/common": "~5.1.0",
"@angular/compiler": "~5.1.0",
"@angular/core": "~5.1.0",
"@angular/forms": "~5.1.0",
"@angular/http": "~5.1.0",
"@angular/platform-browser": "~5.1.0",
"@angular/platform-browser-dynamic": "~5.1.0",
"@angular/router": "~5.1.0",
"nativescript-angular": "next",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
@@ -29,8 +29,8 @@
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/compiler-cli": "~5.0.0",
"@ngtools/webpack": "^1.8.0",
"@angular/compiler-cli": "~5.1.0",
"@ngtools/webpack": "~1.9.0",
"@types/chai": "^4.0.2",
"@types/mocha": "^2.2.41",
"@types/node": "^7.0.5",
@@ -39,9 +39,9 @@
"babylon": "6.18.0",
"chai": "~4.1.1",
"chai-as-promised": "~7.1.1",
"copy-webpack-plugin": "~4.0.1",
"copy-webpack-plugin": "~4.3.0",
"css-loader": "~0.28.7",
"extract-text-webpack-plugin": "~3.0.0",
"extract-text-webpack-plugin": "~3.0.2",
"lazy": "1.0.11",
"mocha": "~3.5.0",
"mocha-junit-reporter": "^1.13.0",
@@ -53,12 +53,12 @@
"nativescript-worker-loader": "~0.8.1",
"node-sass": "^4.7.1",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.1.0",
"resolve-url-loader": "~2.2.1",
"sass-loader": "^6.0.6",
"typescript": "~2.4.2",
"webpack": "~3.8.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "^1.0.2"
"webpack": "~3.10.0",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-sources": "^1.1.0"
},
"scripts": {
"ns-bundle": "ns-bundle",
22 changes: 14 additions & 8 deletions dependencyManager.js
Original file line number Diff line number Diff line change
@@ -58,15 +58,16 @@ function addDependency(deps, name, version, force) {

function getRequiredDeps(packageJson) {
const deps = {
"webpack": "~3.8.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "~1.0.1",
"copy-webpack-plugin": "~4.0.1",
"webpack": "~3.10.0",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-sources": "~1.1.0",
"copy-webpack-plugin": "~4.3.0",
"raw-loader": "~0.5.1",
"css-loader": "~0.28.7",
"nativescript-worker-loader": "~0.8.1",
"resolve-url-loader": "~2.1.0",
"extract-text-webpack-plugin": "~3.0.0",
"resolve-url-loader": "~2.2.1",
"extract-text-webpack-plugin": "~3.0.2",
"uglifyjs-webpack-plugin": "~1.1.6",
};

if (isAngular({packageJson})) {
@@ -100,11 +101,16 @@ function resolveAngularDeps(usedDependencies) {
"typescript": "~2.1.6",
"@ngtools/webpack": "1.2.13",
});
} else {
Object.assign(depsToAdd, {
} else if (angularCoreVersion.startsWith("5.0")) {
Object.assign(depsToAdd, {
"typescript": "~2.4.2",
"@ngtools/webpack": "~1.8.2",
});
} else {
Object.assign(depsToAdd, {
"typescript": "~2.4.2",
"@ngtools/webpack": "~1.9.1",
});
}

return depsToAdd;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-dev-webpack",
"version": "0.9.0",
"version": "0.9.1",
"main": "index",
"description": "",
"homepage": "http://www.telerik.com",
@@ -47,7 +47,7 @@
"shelljs": "^0.6.0"
},
"devDependencies": {
"@ngtools/webpack": "^1.8.0",
"@ngtools/webpack": "~1.9.0",
"@types/node": "^8.0.0",
"source-map-support": "^0.5.0",
"typescript": "^2.6.1"
1 change: 1 addition & 0 deletions plugins/NativeScriptAngularCompilerPlugin.ts
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ export class NativeScriptAngularCompilerPlugin extends AngularCompilerPlugin {
} catch(e) {
}
resolved = resolved || resourceNameToFileName.call(this, file, relativeTo);
resolved = resolved && resolved.replace(/\\/g, "/");
return resolved;
};
}
29 changes: 22 additions & 7 deletions templates/webpack.angular.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

module.exports = env => {
const platform = env && (env.android && "android" || env.ios && "ios");
@@ -60,12 +61,24 @@ module.exports = env => {
{ test: /\.html$|\.xml$/, use: "raw-loader" },

// tns-core-modules reads the app.css and its imports using css-loader
{ test: /\/app\.css$/, use: "css-loader?url=false" },
{ test: /\/app\.scss$/, use: ["css-loader?url=false", "sass-loader"] },
{
test: /[\/|\\]app\.css$/,
use: {
loader: "css-loader",
options: { minimize: false, url: false },
}
},
{
test: /[\/|\\]app\.scss$/,
use: [
{ loader: "css-loader", options: { minimize: false, url: false } },
"sass-loader"
]
},

// Angular components reference css files and their imports using raw-loader
{ test: /\.css$/, exclude: /\/app\.css$/, use: "raw-loader" },
{ test: /\.scss$/, exclude: /\/app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
{ test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: "raw-loader" },
{ test: /\.scss$/, exclude: /[\/|\\]app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },

// Compile TypeScript files with ahead-of-time compiler.
{ test: /.ts$/, use: [
@@ -139,9 +152,11 @@ module.exports = env => {

// Work around an Android issue by setting compress = false
const compress = platform !== "android";
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
mangle: { except: nsWebpack.uglifyMangleExcludes },
compress,
config.plugins.push(new UglifyJsPlugin({
uglifyOptions: {
mangle: { reserved: nsWebpack.uglifyMangleExcludes },
compress,
}
}));
}
return config;
23 changes: 18 additions & 5 deletions templates/webpack.javascript.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

module.exports = env => {
const platform = env && (env.android && "android" || env.ios && "ios");
@@ -57,8 +58,18 @@ module.exports = env => {
rules: [
{ test: /\.(html|xml)$/, use: "raw-loader" },

{ test: /\.css$/, use: "css-loader?url=false" },
{ test: /\.scss$/, use: ["css-loader?url=false", "sass-loader"] },
{
test: /\.css$/,
use: { loader: "css-loader", options: { minimize: false, url: false } }
},

{
test: /\.scss$/,
use: [
{ loader: "css-loader", options: { minimize: false, url: false } },
"sass-loader"
]
}
]
},
plugins: [
@@ -119,9 +130,11 @@ module.exports = env => {

// Work around an Android issue by setting compress = false
const compress = platform !== "android";
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
mangle: { except: nsWebpack.uglifyMangleExcludes },
compress,
config.plugins.push(new UglifyJsPlugin({
uglifyOptions: {
mangle: { reserved: nsWebpack.uglifyMangleExcludes },
compress,
}
}));
}
return config;
24 changes: 18 additions & 6 deletions templates/webpack.typescript.js
Original file line number Diff line number Diff line change
@@ -6,14 +6,14 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

module.exports = env => {
const platform = env && (env.android && "android" || env.ios && "ios");
if (!platform) {
throw new Error("You need to provide a target platform!");
}
const platforms = ["ios", "android"];
const mainSheet = "app.css";
const { snapshot, uglify, report } = env;

const config = {
@@ -58,8 +58,18 @@ module.exports = env => {
rules: [
{ test: /\.(html|xml)$/, use: "raw-loader" },

{ test: /\.css$/, use: "css-loader?url=false" },
{ test: /\.scss$/, use: ["css-loader?url=false", "sass-loader"] },
{
test: /\.css$/,
use: { loader: "css-loader", options: { minimize: false, url: false } }
},

{
test: /\.scss$/,
use: [
{ loader: "css-loader", options: { minimize: false, url: false } },
"sass-loader"
]
},

{ test: /\.ts$/, use: "awesome-typescript-loader" }
]
@@ -122,9 +132,11 @@ module.exports = env => {

// Work around an Android issue by setting compress = false
const compress = platform !== "android";
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
mangle: { except: nsWebpack.uglifyMangleExcludes },
compress,
config.plugins.push(new UglifyJsPlugin({
uglifyOptions: {
mangle: { reserved: nsWebpack.uglifyMangleExcludes },
compress,
}
}));
}
return config;