mirror of https://github.com/Ombi-app/Ombi
Merge pull request #2411 from tidusjar/feature/angular6-webpack4
Feature angular6 webpack4pull/2420/head^2
commit
09d9f62905
@ -1,23 +1,10 @@
|
||||
/wwwroot/css/**
|
||||
/wwwroot/fonts/**
|
||||
/wwwroot/lib/**
|
||||
/wwwroot/maps/**
|
||||
/wwwroot/dist/**
|
||||
/wwwroot/*.js.map
|
||||
/wwwroot/*.js
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/bower_components
|
||||
|
||||
# misc
|
||||
node_modules
|
||||
bin
|
||||
obj
|
||||
wwwroot/dist
|
||||
*.log
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage/*
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
#/typings
|
||||
/systemjs.config.js*
|
||||
/Logs/**
|
||||
**.db
|
||||
|
@ -1,2 +0,0 @@
|
||||
import "rxjs/add/operator/catch";
|
||||
import "rxjs/add/operator/map";
|
File diff suppressed because it is too large
Load Diff
@ -1,94 +1,93 @@
|
||||
{
|
||||
"name": "ombi",
|
||||
"version": "2.6.0",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"vendor": "gulp vendor",
|
||||
"main": "gulp main",
|
||||
"lint": "tslint -p .",
|
||||
"publish": "gulp publish",
|
||||
"lint": "tslint ClientApp/**/*.ts",
|
||||
"restore": "dotnet restore && npm install"
|
||||
"restore": "dotnet restore && yarn install",
|
||||
"clean": "gulp clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "^5.2.5",
|
||||
"@angular/cdk": "^5.2.1",
|
||||
"@angular/common": "^5.2.5",
|
||||
"@angular/compiler": "^5.2.5",
|
||||
"@angular/core": "^5.2.5",
|
||||
"@angular/forms": "^5.2.5",
|
||||
"@angular/http": "^5.2.5",
|
||||
"@angular/material": "^5.2.1",
|
||||
"@angular/platform-browser": "^5.2.5",
|
||||
"@angular/platform-browser-dynamic": "^5.2.5",
|
||||
"@angular/platform-server": "^5.2.5",
|
||||
"@angular/router": "^5.2.5",
|
||||
"@auth0/angular-jwt": "1.0.0-beta.9",
|
||||
"@ng-bootstrap/ng-bootstrap": "^1.0.0",
|
||||
"@ngu/carousel": "^1.4.8",
|
||||
"@ngx-translate/core": "^8.0.0",
|
||||
"@ngx-translate/http-loader": "^2.0.1",
|
||||
"@types/core-js": "^0.9.46",
|
||||
"@types/extract-text-webpack-plugin": "^3.0.1",
|
||||
"@types/intro.js": "^2.4.3",
|
||||
"@types/node": "^8.9.4",
|
||||
"@types/webpack": "^3.8.7",
|
||||
"angular-router-loader": "^0.8.2",
|
||||
"angular2-moment": "^1.8.0",
|
||||
"@angular/animations": "^6.0.7",
|
||||
"@angular/cdk": "^6.3.1",
|
||||
"@angular/common": "^6.0.7",
|
||||
"@angular/compiler": "^6.0.7",
|
||||
"@angular/compiler-cli": "^6.0.7",
|
||||
"@angular/core": "^6.0.7",
|
||||
"@angular/forms": "^6.0.7",
|
||||
"@angular/http": "^6.0.7",
|
||||
"@angular/material": "^6.3.1",
|
||||
"@angular/platform-browser": "^6.0.7",
|
||||
"@angular/platform-browser-dynamic": "^6.0.7",
|
||||
"@angular/platform-server": "^6.0.7",
|
||||
"@angular/router": "^6.0.7",
|
||||
"@auth0/angular-jwt": "^2.0.0",
|
||||
"@ng-bootstrap/ng-bootstrap": "^2.2.0",
|
||||
"@ngtools/webpack": "^6.1.0-beta.2",
|
||||
"@ngu/carousel": "^1.4.9-beta-2",
|
||||
"@ngx-translate/core": "^10.0.2",
|
||||
"@ngx-translate/http-loader": "^3.0.1",
|
||||
"@types/core-js": "^2.5.0",
|
||||
"@types/mini-css-extract-plugin": "^0.2.0",
|
||||
"@types/node": "^10.5.1",
|
||||
"@types/webpack": "^4.4.4",
|
||||
"@types/webpack-bundle-analyzer": "^2.9.2",
|
||||
"@types/webpack-merge": "^4.1.3",
|
||||
"angular-router-loader": "^0.8.5",
|
||||
"angular2-template-loader": "^0.6.2",
|
||||
"aspnet-webpack": "^2.0.3",
|
||||
"awesome-typescript-loader": "^3.4.1",
|
||||
"aspnet-webpack": "^3.0.0",
|
||||
"awesome-typescript-loader": "^5.2.0",
|
||||
"bootstrap": "3.3.7",
|
||||
"bootswatch": "3.3.7",
|
||||
"core-js": "^2.5.3",
|
||||
"css": "^2.2.1",
|
||||
"css-loader": "^0.28.9",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"core-js": "^2.5.7",
|
||||
"css": "^2.2.3",
|
||||
"css-loader": "^0.28.11",
|
||||
"del": "^3.0.0",
|
||||
"event-source-polyfill": "^0.0.11",
|
||||
"expose-loader": "^0.7.4",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^1.1.6",
|
||||
"event-source-polyfill": "^0.0.12",
|
||||
"expose-loader": "^0.7.5",
|
||||
"file-loader": "^1.1.11",
|
||||
"font-awesome": "^4.7.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-run": "^1.7.1",
|
||||
"hammerjs": "^2.0.8",
|
||||
"html-loader": "0.5.1",
|
||||
"html-loader": "^0.5.5",
|
||||
"jquery": "^3.3.1",
|
||||
"mini-css-extract-plugin": "^0.4.1",
|
||||
"moment": "^2.22.2",
|
||||
"ng2-cookies": "^1.0.12",
|
||||
"ngx-clipboard": "8.1.1",
|
||||
"ngx-infinite-scroll": "^0.6.1",
|
||||
"ngx-clipboard": "^11.1.1",
|
||||
"ngx-infinite-scroll": "^6.0.1",
|
||||
"ngx-moment": "^3.0.1",
|
||||
"ngx-order-pipe": "^2.0.1",
|
||||
"node-sass": "^4.7.2",
|
||||
"npm": "^5.6.0",
|
||||
"node-sass": "^4.9.0",
|
||||
"pace-progress": "^1.0.2",
|
||||
"primeng": "5.0.2",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"primeng": "^6.0.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"reflect-metadata": "^0.1.12",
|
||||
"run-sequence": "^2.2.1",
|
||||
"rxjs": "5.5.2",
|
||||
"sass-loader": "^6.0.6",
|
||||
"style-loader": "^0.19.1",
|
||||
"rxjs": "^6.2.1",
|
||||
"sass-loader": "^7.0.3",
|
||||
"style-loader": "^0.21.0",
|
||||
"to-string-loader": "^1.1.5",
|
||||
"ts-node": "^3.3.0",
|
||||
"tslint": "^5.9.1",
|
||||
"tslint-language-service": "^0.9.8",
|
||||
"typescript": "^2.7.1",
|
||||
"uglify-es": "^3.3.10",
|
||||
"uglifyjs-webpack-plugin": "^1.1.8",
|
||||
"url-loader": "^0.6.2",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-bundle-analyzer": "^2.10.0",
|
||||
"webpack-hot-middleware": "^2.21.0",
|
||||
"zone.js": "^0.8.20"
|
||||
"ts-node": "^7.0.0",
|
||||
"tslint": "^5.10.0",
|
||||
"tslint-language-service": "^0.9.9",
|
||||
"typescript": "2.7.2",
|
||||
"uglify-es": "^3.3.9",
|
||||
"uglifyjs-webpack-plugin": "^1.2.7",
|
||||
"url-loader": "^1.0.1",
|
||||
"webpack": "^4.14.0",
|
||||
"webpack-bundle-analyzer": "^2.13.1",
|
||||
"webpack-cli": "^3.0.8",
|
||||
"webpack-dev-middleware": "^3.1.3",
|
||||
"webpack-hot-middleware": "^2.22.2",
|
||||
"webpack-merge": "^4.1.3",
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "4.0.4",
|
||||
"@types/jasmine": "2.6.2",
|
||||
"chai": "4.1.2",
|
||||
"jasmine-core": "2.8.0",
|
||||
"karma": "1.7.1",
|
||||
"karma-chai": "0.1.0",
|
||||
"karma-chrome-launcher": "2.2.0",
|
||||
"karma-cli": "1.0.1",
|
||||
"karma-jasmine": "1.1.0",
|
||||
"karma-webpack": "2.0.5"
|
||||
"resolutions": {
|
||||
"@types/tapable": "1.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
// Globals
|
||||
|
||||
declare module "pace-progress";
|
||||
declare var __webpack_public_path__: any;
|
@ -1 +1 @@
|
||||
/// <reference path="globals/globals.d.ts" />
|
||||
/// <reference path="globals.d.ts" />
|
||||
|
@ -0,0 +1,83 @@
|
||||
import { AngularCompilerPlugin } from "@ngtools/webpack";
|
||||
import * as MiniCssExtractPlugin from "mini-css-extract-plugin";
|
||||
import * as path from "path";
|
||||
import { Configuration, ContextReplacementPlugin, ProvidePlugin } from "webpack";
|
||||
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
||||
|
||||
export const outputDir = "./wwwroot/dist";
|
||||
|
||||
export function isProd(env: any) {
|
||||
return env && env.prod as boolean;
|
||||
}
|
||||
|
||||
export function isAOT(env: any) {
|
||||
return env && env.aot as boolean;
|
||||
}
|
||||
|
||||
export const WebpackCommonConfig = (env: any, type: string) => {
|
||||
const prod = isProd(env);
|
||||
const aot = isAOT(env);
|
||||
const vendor = type === "vendor";
|
||||
console.log(`${prod ? "Production" : "Dev"} ${type} build`);
|
||||
console.log(`Output directory: ${outputDir}`);
|
||||
console.log(`${aot ? "Using" : "Not using"} AOT compiler`);
|
||||
const analyse = env && env.analyse as boolean;
|
||||
if (analyse) { console.log("Analysing build"); }
|
||||
const cssLoader = prod ? "css-loader?minimize" : "css-loader";
|
||||
const bundleConfig: Configuration = {
|
||||
mode: prod ? "production" : "development",
|
||||
resolve: {
|
||||
extensions: [".ts", ".js"],
|
||||
alias: {
|
||||
pace: "pace-progress",
|
||||
},
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(outputDir),
|
||||
filename: "[name].js",
|
||||
chunkFilename: "[id].chunk.js",
|
||||
publicPath: "/dist/",
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.ts$/, loader: aot ? "@ngtools/webpack" : ["awesome-typescript-loader?silent=true", "angular2-template-loader", "angular-router-loader"] },
|
||||
{ test: /\.html$/, use: "html-loader?minimize=false" },
|
||||
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, cssLoader] },
|
||||
{ test: /\.scss$/, exclude: /ClientApp/, use: [MiniCssExtractPlugin.loader, cssLoader, "sass-loader"] },
|
||||
{ test: /\.scss$/, include: /ClientApp(\\|\/)app/, use: ["to-string-loader", cssLoader, "sass-loader"] },
|
||||
{ test: /\.scss$/, include: /ClientApp(\\|\/)styles/, use: ["style-loader", cssLoader, "sass-loader"] },
|
||||
{ test: /\.(png|jpg|jpeg|gif|woff|woff2|eot|ttf|svg)(\?|$)/, use: "url-loader?limit=8192" },
|
||||
{ test: /[\/\\]@angular[\/\\].+\.js$/, parser: { system: true } }, // ignore System.import warnings https://github.com/angular/angular/issues/21560
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
}),
|
||||
new ProvidePlugin({ $: "jquery", jQuery: "jquery", Hammer: "hammerjs/hammer" }), // Global identifiers
|
||||
].concat(aot && !vendor ? [
|
||||
new AngularCompilerPlugin({
|
||||
mainPath: "./ClientApp/main.ts",
|
||||
tsConfigPath: "./tsconfig.json",
|
||||
skipCodeGeneration: false,
|
||||
compilerOptions: {
|
||||
noEmit: false,
|
||||
},
|
||||
}),
|
||||
] : [
|
||||
// AOT chunk splitting does not work while this is active but doesn't seem to be needed under AOT anyway https://github.com/angular/angular-cli/issues/4431
|
||||
new ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)/, path.join(__dirname, "./ClientApp")), // Workaround for https://github.com/angular/angular/issues/14898
|
||||
]).concat(analyse ? [
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: "static",
|
||||
reportFilename: `${type}.html`,
|
||||
openAnalyzer: false,
|
||||
}),
|
||||
] : []),
|
||||
node: {
|
||||
fs: "empty",
|
||||
},
|
||||
};
|
||||
|
||||
return bundleConfig;
|
||||
};
|
@ -1,59 +1,26 @@
|
||||
import { CheckerPlugin } from "awesome-typescript-loader";
|
||||
import * as path from "path";
|
||||
import * as UglifyJSPlugin from "uglifyjs-webpack-plugin";
|
||||
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
||||
import { Configuration, DllReferencePlugin } from "webpack";
|
||||
import * as webpackMerge from "webpack-merge";
|
||||
|
||||
import * as webpack from "webpack";
|
||||
import { isAOT, isProd, outputDir, WebpackCommonConfig } from "./webpack.config.common";
|
||||
|
||||
module.exports = (env: any) => {
|
||||
// const prod = env && env.prod as boolean;
|
||||
const prod = true;
|
||||
console.log(prod ? "Production" : "Dev" + " main build");
|
||||
const analyse = env && env.analyse as boolean;
|
||||
if (analyse) { console.log("Analysing build"); }
|
||||
const cssLoader = prod ? "css-loader?-url&minimize" : "css-loader?-url";
|
||||
const outputDir = "./wwwroot/dist";
|
||||
const bundleConfig: webpack.Configuration = {
|
||||
entry: { main: "./ClientApp/main.ts" },
|
||||
stats: { modules: false },
|
||||
context: __dirname,
|
||||
resolve: { extensions: [".ts", ".js"] },
|
||||
devtool: prod ? "source-map" : "eval-source-map",
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
chunkFilename: "[id].[chunkhash].js",
|
||||
publicPath: "/dist/",
|
||||
path: path.join(__dirname, outputDir),
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.ts$/, include: /ClientApp/, use: ["awesome-typescript-loader?silent=true", "angular2-template-loader", "angular-router-loader"] },
|
||||
{ test: /\.html$/, use: "html-loader?minimize=false" },
|
||||
{ test: /\.css$/, use: ["to-string-loader", cssLoader] },
|
||||
{ test: /\.scss$/, include: /ClientApp(\\|\/)app/, use: ["to-string-loader", cssLoader, "sass-loader"] },
|
||||
{ test: /\.scss$/, include: /ClientApp(\\|\/)styles/, use: ["style-loader", cssLoader, "sass-loader"] },
|
||||
{ test: /\.(png|jpg|jpeg|gif|svg)$/, use: "url-loader?limit=25000" },
|
||||
],
|
||||
const prod = isProd(env);
|
||||
const aot = isAOT(env);
|
||||
if (!prod && aot) { console.warn("Vendor dll bundle will not be used as AOT is enabled"); }
|
||||
const bundleConfig: Configuration = webpackMerge(WebpackCommonConfig(env, "main"), {
|
||||
entry: {
|
||||
app: "./ClientApp/main.ts",
|
||||
},
|
||||
plugins: [
|
||||
new CheckerPlugin(),
|
||||
new webpack.DllReferencePlugin({
|
||||
devtool: prod ? "source-map" : "eval-source-map",
|
||||
plugins: prod || aot ? [] : [
|
||||
// AOT chunk splitting does not work while this is active https://github.com/angular/angular-cli/issues/4565
|
||||
new DllReferencePlugin({
|
||||
context: __dirname,
|
||||
manifest: require(path.join(__dirname, outputDir, "vendor-manifest.json")),
|
||||
}),
|
||||
].concat(prod ? [
|
||||
// Plugins that apply in production builds only
|
||||
new UglifyJSPlugin({ sourceMap: true }),
|
||||
] : [
|
||||
// Plugins that apply in development builds only
|
||||
]).concat(analyse ? [
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: "static",
|
||||
reportFilename: "main.html",
|
||||
openAnalyzer: false,
|
||||
}),
|
||||
] : []),
|
||||
};
|
||||
],
|
||||
});
|
||||
|
||||
return bundleConfig;
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue