├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── .travis.yml ├── README.md ├── api ├── .gitignore ├── .meteor │ ├── .finished-upgraders │ ├── .gitignore │ ├── .id │ ├── packages │ ├── platforms │ ├── release │ └── versions ├── declarations.d.ts ├── node_modules ├── package-lock.json ├── package.json ├── server │ ├── collections │ │ ├── chats.ts │ │ ├── index.ts │ │ └── messages.ts │ ├── main.ts │ └── models.ts └── tsconfig.json ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── patches ├── tsconfig.app.json.patch ├── tsconfig.e2e.json.patch ├── tsconfig.json.patch ├── tsconfig.spec.json.patch ├── webpack.config.js.patch └── webpack.config.js.prod.patch ├── protractor.conf.js ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ └── app.module.ts ├── assets │ └── .gitkeep ├── declarations.d.ts ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.scss ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json ├── tslint.json ├── webpack.config.js ├── webpack.config.js.dev └── webpack.config.js.prod /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "angularcli-meteor", 5 | "ejected": true 6 | }, 7 | "apps": [ 8 | { 9 | "root": "src", 10 | "outDir": "dist", 11 | "assets": [ 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "tsconfig.app.json", 20 | "testTsconfig": "tsconfig.spec.json", 21 | "prefix": "app", 22 | "styles": [ 23 | "styles.scss" 24 | ], 25 | "scripts": [], 26 | "environmentSource": "environments/environment.ts", 27 | "environments": { 28 | "dev": "environments/environment.ts", 29 | "prod": "environments/environment.prod.ts" 30 | } 31 | } 32 | ], 33 | "e2e": { 34 | "protractor": { 35 | "config": "./protractor.conf.js" 36 | } 37 | }, 38 | "lint": [ 39 | { 40 | "project": "src/tsconfig.app.json", 41 | "exclude": "**/node_modules/**" 42 | }, 43 | { 44 | "project": "src/tsconfig.spec.json", 45 | "exclude": "**/node_modules/**" 46 | }, 47 | { 48 | "project": "e2e/tsconfig.e2e.json", 49 | "exclude": "**/node_modules/**" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "scss", 59 | "component": { 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | sudo: required 3 | 4 | language: node_js 5 | node_js: 6 | - "8" 7 | 8 | services: 9 | - mongodb 10 | 11 | cache: 12 | directories: 13 | - ./node_modules 14 | 15 | before_install: 16 | - "curl -L https://raw.githubusercontent.com/arunoda/travis-ci-meteor-packages/master/configure.sh | /bin/sh" 17 | - rm -rf node_modules 18 | 19 | install: 20 | - git clean -fXd 21 | - npm install -g concurrently 22 | - npm install 23 | - meteor npm rebuild 24 | - npm run meteor-client:bundle 25 | - npm run api:reset 26 | 27 | before_script: 28 | - "export PATH=$HOME/.meteor:$PATH" 29 | 30 | script: 31 | # Use Chromium instead of Chrome. 32 | - export CHROME_BIN=chromium-browser 33 | - npm run test 34 | - concurrently "npm run start" "npm run api" "sleep 200; npm run e2e" --kill-others --success first 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AngularcliMeteor 2 | 3 | ## Meteor server 4 | 5 | Run `meteor` from the `api` directory to start the Meteor server. 6 | 7 | ## Bundling Meteor client 8 | 9 | `meteor-client-bundler` is a module bundler which will take a bunch of Atmosphere package and put them into a single module, so we can load Meteor's client scripts regardless of what framework we're using to run our server. 10 | 11 | Run `./node_modules/.bin/meteor-client bundle -s api`. 12 | 13 | ## Development server 14 | 15 | Then run `npm run start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 16 | 17 | ## Build 18 | 19 | Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. Use `npm run build-prod` for a production build with AOT. 20 | 21 | ## Running unit tests 22 | 23 | Run `npm run test` to execute the unit tests via [Karma](https://karma-runner.github.io). 24 | 25 | ## Running end-to-end tests 26 | 27 | Run `npm run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 28 | 29 | ## The process I've done to recreate this 30 | 31 | ``` 32 | ng new angularcli-meteor --style scss 33 | cd angularcli-meteor 34 | ng eject 35 | ``` 36 | We need to eject `webpack.config.js` to be able to patch it to support Meteor. 37 | 38 | ``` 39 | cat patches/webpack.config.js.patch | patch -p1 40 | cat patches/tsconfig.json.patch | patch -p1 41 | cat patches/tsconfig.app.json.patch | patch -p1 42 | cat patches/tsconfig.spec.json.patch | patch -p1 43 | cat patches/tsconfig.e2e.json.patch | patch -p1 44 | ``` 45 | 46 | ``` 47 | npm install --save-dev typescript-extends 48 | npm install --save moment 49 | npm install --save angular2-moment 50 | ``` 51 | 52 | ``` 53 | meteor create api --release 1.6-rc.13 54 | npm install --save babel-runtime 55 | npm install --save meteor-node-stubs 56 | npm install --save meteor-rxjs 57 | npm install --save-dev meteor-client-bundler 58 | npm install --save-dev @types/meteor 59 | npm install --save-dev tmp 60 | rm -rf api/node_modules 61 | rm -rf api/client 62 | mv api/server/main.js api/server/main.ts 63 | rm api/package.json api/package-lock.json 64 | ln -s ../package.json api/package.json 65 | ln -s ../package-lock.json api/package-lock.json 66 | ln -s ../node_modules api/ 67 | cd api; meteor add barbatus:typescript; cd .. 68 | ``` 69 | 70 | Now we need to create `api/tsconfig.json`. 71 | 72 | To get the AOT config we will need to eject `webpack.config.js` once again, this time with the `--prod` flag. 73 | To be able to do so we will first have to remove all the "run" scripts from package.json. 74 | 75 | ``` 76 | mv webpack.config.js webpack.config.js.dev 77 | ng eject --prod 78 | cat patches/webpack.config.js.prod.patch | patch -p1 79 | mv webpack.config.js webpack.config.js.prod 80 | ln -s webpack.config.js.dev webpack.config.js 81 | ``` 82 | 83 | Finally let's add `start-prod` and `build-prod` to the "run" scripts from package.json. 84 | -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /api/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | -------------------------------------------------------------------------------- /api/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /api/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | clttq3hf42le.i75ivc3fspio 8 | -------------------------------------------------------------------------------- /api/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.2.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.0.5 # Packages for a great mobile UX 9 | mongo@1.3.0 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.1.3 # Meteor's client-side reactive programming library 12 | 13 | standard-minifier-css@1.3.5 # CSS minifier run for production mode 14 | standard-minifier-js@2.2.0 # JS minifier run for production mode 15 | es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers 16 | ecmascript@0.9.0 # Enable ECMAScript2015+ syntax in app code 17 | shell-server@0.3.0 # Server-side component of the `meteor shell` command 18 | 19 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 20 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 21 | angular-compilers 22 | -------------------------------------------------------------------------------- /api/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /api/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.6 2 | -------------------------------------------------------------------------------- /api/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.2.9_2 3 | angular-html-compiler@0.2.9 4 | angular-scss-compiler@0.2.9 5 | angular-typescript-compiler@0.2.9_5 6 | autopublish@1.0.7 7 | autoupdate@1.3.12 8 | babel-compiler@6.24.7 9 | babel-runtime@1.1.1 10 | base64@1.0.10 11 | binary-heap@1.0.10 12 | boilerplate-generator@1.3.1 13 | callback-hook@1.0.10 14 | check@1.2.5 15 | ddp@1.4.0 16 | ddp-client@2.2.0 17 | ddp-common@1.3.0 18 | ddp-server@2.1.1 19 | diff-sequence@1.0.7 20 | dynamic-import@0.2.1 21 | ecmascript@0.9.0 22 | ecmascript-runtime@0.5.0 23 | ecmascript-runtime-client@0.5.0 24 | ecmascript-runtime-server@0.5.0 25 | ejson@1.1.0 26 | es5-shim@4.6.15 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | http@1.3.0 30 | id-map@1.0.9 31 | insecure@1.0.7 32 | launch-screen@1.1.1 33 | livedata@1.0.18 34 | logging@1.1.19 35 | meteor@1.8.2 36 | meteor-base@1.2.0 37 | minifier-css@1.2.16 38 | minifier-js@2.2.2 39 | minimongo@1.4.2 40 | mobile-experience@1.0.5 41 | mobile-status-bar@1.0.14 42 | modules@0.11.0 43 | modules-runtime@0.9.1 44 | mongo@1.3.0 45 | mongo-dev-server@1.1.0 46 | mongo-id@1.0.6 47 | npm-mongo@2.2.33 48 | ordered-dict@1.0.9 49 | promise@0.10.0 50 | random@1.0.10 51 | reactive-var@1.0.11 52 | reload@1.1.11 53 | retry@1.0.9 54 | routepolicy@1.0.12 55 | shell-server@0.3.0 56 | standard-minifier-css@1.3.5 57 | standard-minifier-js@2.2.3 58 | tmeasday:check-npm-versions@0.3.1 59 | tracker@1.1.3 60 | underscore@1.0.10 61 | url@1.1.0 62 | webapp@1.4.0 63 | webapp-hashing@1.0.9 64 | -------------------------------------------------------------------------------- /api/declarations.d.ts: -------------------------------------------------------------------------------- 1 | ../src/declarations.d.ts -------------------------------------------------------------------------------- /api/node_modules: -------------------------------------------------------------------------------- 1 | ../node_modules -------------------------------------------------------------------------------- /api/package-lock.json: -------------------------------------------------------------------------------- 1 | ../package-lock.json -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | ../package.json -------------------------------------------------------------------------------- /api/server/collections/chats.ts: -------------------------------------------------------------------------------- 1 | import { MongoObservable } from 'meteor-rxjs'; 2 | import { Chat } from '../models'; 3 | 4 | export const Chats = new MongoObservable.Collection('chats'); 5 | -------------------------------------------------------------------------------- /api/server/collections/index.ts: -------------------------------------------------------------------------------- 1 | export * from './chats'; 2 | export * from './messages'; 3 | -------------------------------------------------------------------------------- /api/server/collections/messages.ts: -------------------------------------------------------------------------------- 1 | import { MongoObservable } from 'meteor-rxjs'; 2 | import { Message } from '../models'; 3 | 4 | export const Messages = new MongoObservable.Collection('messages'); 5 | -------------------------------------------------------------------------------- /api/server/main.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Chats } from './collections/chats'; 3 | import { Messages } from './collections/messages'; 4 | import * as moment from 'moment'; 5 | import { MessageType } from './models'; 6 | 7 | Meteor.startup(() => { 8 | if (Chats.find({}).cursor.count() === 0) { 9 | let chatId; 10 | 11 | chatId = Chats.collection.insert({ 12 | title: 'Ethan Gonzalez', 13 | picture: 'https://randomuser.me/api/portraits/thumb/men/1.jpg' 14 | }); 15 | 16 | Messages.collection.insert({ 17 | chatId: chatId, 18 | content: 'You on your way?', 19 | createdAt: moment().subtract(1, 'hours').toDate(), 20 | type: MessageType.TEXT 21 | }); 22 | 23 | chatId = Chats.collection.insert({ 24 | title: 'Bryan Wallace', 25 | picture: 'https://randomuser.me/api/portraits/thumb/lego/1.jpg' 26 | }); 27 | 28 | Messages.collection.insert({ 29 | chatId: chatId, 30 | content: 'Hey, it\'s me', 31 | createdAt: moment().subtract(2, 'hours').toDate(), 32 | type: MessageType.TEXT 33 | }); 34 | 35 | chatId = Chats.collection.insert({ 36 | title: 'Avery Stewart', 37 | picture: 'https://randomuser.me/api/portraits/thumb/women/1.jpg' 38 | }); 39 | 40 | Messages.collection.insert({ 41 | chatId: chatId, 42 | content: 'I should buy a boat', 43 | createdAt: moment().subtract(1, 'days').toDate(), 44 | type: MessageType.TEXT 45 | }); 46 | 47 | chatId = Chats.collection.insert({ 48 | title: 'Katie Peterson', 49 | picture: 'https://randomuser.me/api/portraits/thumb/women/2.jpg' 50 | }); 51 | 52 | Messages.collection.insert({ 53 | chatId: chatId, 54 | content: 'Look at my mukluks!', 55 | createdAt: moment().subtract(4, 'days').toDate(), 56 | type: MessageType.TEXT 57 | }); 58 | 59 | chatId = Chats.collection.insert({ 60 | title: 'Ray Edwards', 61 | picture: 'https://randomuser.me/api/portraits/thumb/men/2.jpg' 62 | }); 63 | 64 | Messages.collection.insert({ 65 | chatId: chatId, 66 | content: 'This is wicked good ice cream.', 67 | createdAt: moment().subtract(2, 'weeks').toDate(), 68 | type: MessageType.TEXT 69 | }); 70 | } 71 | }); 72 | -------------------------------------------------------------------------------- /api/server/models.ts: -------------------------------------------------------------------------------- 1 | export enum MessageType { 2 | TEXT = 'text' 3 | } 4 | 5 | export interface Chat { 6 | _id?: string; 7 | title?: string; 8 | picture?: string; 9 | lastMessage?: Message; 10 | memberIds?: string[]; 11 | } 12 | 13 | export interface Message { 14 | _id?: string; 15 | chatId?: string; 16 | senderId?: string; 17 | content?: string; 18 | createdAt?: Date; 19 | type?: MessageType 20 | ownership?: string; 21 | } 22 | -------------------------------------------------------------------------------- /api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2017" 10 | ], 11 | "module": "commonjs", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "target": "es6", 15 | "skipLibCheck": true, 16 | "stripInternal": true, 17 | "noImplicitAny": false, 18 | "types": [ 19 | "@types/meteor" 20 | ] 21 | }, 22 | "exclude": [ 23 | "node_modules" 24 | ], 25 | "compileOnSave": false, 26 | "atom": { 27 | "rewriteTsconfig": false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('angularcli-meteor App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | 15 | it('should load chats from the Meteor backend', () => { 16 | page.navigateTo(); 17 | expect(page.getLastDiv()).toContain('Ethan Gonzalez'); 18 | expect(page.getLastDiv()).toContain('Bryan Wallace'); 19 | expect(page.getLastDiv()).toContain('Avery Stewart'); 20 | expect(page.getLastDiv()).toContain('Katie Peterson'); 21 | expect(page.getLastDiv()).toContain('Ray Edwards'); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | 12 | getLastDiv() { 13 | return element(by.css('app-root div:last-child')).getText(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | }, 14 | "exclude": [ 15 | "../api/node_modules" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['ChromeHeadlessNoSandbox'], 31 | customLaunchers: { 32 | ChromeHeadlessNoSandbox: { 33 | base: 'ChromeHeadless', 34 | flags: [ 35 | '--no-sandbox', // required to run without privileges in docker 36 | '--user-data-dir=/tmp/chrome-test-profile', 37 | '--disable-web-security' 38 | ] 39 | } 40 | }, 41 | singleRun: true 42 | }); 43 | }; 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angularcli-meteor", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "lint": "ng lint", 8 | "pree2e": "webdriver-manager update --standalone false --gecko false --quiet", 9 | "build": "webpack", 10 | "build-prod": "webpack --config webpack.config.js.prod", 11 | "start": "webpack-dev-server --port=4200", 12 | "start-prod": "webpack-dev-server --port=4200 --config webpack.config.js.prod", 13 | "test": "karma start ./karma.conf.js", 14 | "e2e": "protractor ./protractor.conf.js", 15 | "api": "cd api && meteor", 16 | "api:reset": "cd api && meteor reset", 17 | "meteor-client:bundle": "meteor-client bundle -s api" 18 | }, 19 | "private": true, 20 | "dependencies": { 21 | "@angular/animations": "^5.0.0", 22 | "@angular/common": "^5.0.0", 23 | "@angular/compiler": "^5.0.0", 24 | "@angular/core": "^5.0.0", 25 | "@angular/forms": "^5.0.0", 26 | "@angular/http": "^5.0.0", 27 | "@angular/platform-browser": "^5.0.0", 28 | "@angular/platform-browser-dynamic": "^5.0.0", 29 | "@angular/router": "^5.0.0", 30 | "angular2-moment": "^1.7.0", 31 | "babel-runtime": "^6.26.0", 32 | "core-js": "^2.4.1", 33 | "meteor-node-stubs": "^0.3.2", 34 | "meteor-rxjs": "^0.4.8", 35 | "moment": "^2.19.3", 36 | "rxjs": "^5.5.2", 37 | "zone.js": "^0.8.14" 38 | }, 39 | "devDependencies": { 40 | "@angular/cli": "1.6.0", 41 | "@angular/compiler-cli": "^5.0.0", 42 | "@angular/language-service": "^5.0.0", 43 | "@types/jasmine": "~2.5.53", 44 | "@types/jasminewd2": "~2.0.2", 45 | "@types/meteor": "^1.4.12", 46 | "@types/node": "~6.0.60", 47 | "autoprefixer": "^6.5.3", 48 | "circular-dependency-plugin": "^4.2.1", 49 | "codelyzer": "^4.0.1", 50 | "copy-webpack-plugin": "^4.1.1", 51 | "css-loader": "^0.28.1", 52 | "cssnano": "^3.10.0", 53 | "exports-loader": "^0.6.3", 54 | "file-loader": "^1.1.5", 55 | "html-webpack-plugin": "^2.29.0", 56 | "istanbul-instrumenter-loader": "^2.0.0", 57 | "jasmine-core": "~2.6.2", 58 | "jasmine-spec-reporter": "~4.1.0", 59 | "karma": "~1.7.0", 60 | "karma-chrome-launcher": "~2.1.1", 61 | "karma-cli": "~1.0.1", 62 | "karma-coverage-istanbul-reporter": "^1.2.1", 63 | "karma-jasmine": "~1.1.0", 64 | "karma-jasmine-html-reporter": "^0.2.2", 65 | "less-loader": "^4.0.5", 66 | "meteor-client-bundler": "^0.3.0", 67 | "postcss-loader": "^2.0.8", 68 | "postcss-url": "^7.1.2", 69 | "protractor": "~5.1.2", 70 | "raw-loader": "^0.5.1", 71 | "sass-loader": "^6.0.3", 72 | "source-map-loader": "^0.2.0", 73 | "style-loader": "^0.13.1", 74 | "stylus-loader": "^3.0.1", 75 | "tmp": "0.0.33", 76 | "ts-node": "~3.2.0", 77 | "tslint": "~5.7.0", 78 | "typescript": "~2.4.2", 79 | "typescript-extends": "^1.0.1", 80 | "uglifyjs-webpack-plugin": "~1.1.2", 81 | "url-loader": "^0.6.2", 82 | "webpack": "~3.10.0", 83 | "webpack-concat-plugin": "^1.4.2", 84 | "webpack-dev-server": "~2.9.3" 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /patches/tsconfig.app.json.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json 2 | index 39ba8db..b4e3ee8 100644 3 | --- a/src/tsconfig.app.json 4 | +++ b/src/tsconfig.app.json 5 | @@ -8,6 +8,7 @@ 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | - "**/*.spec.ts" 10 | + "**/*.spec.ts", 11 | + "../api/node_modules" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /patches/tsconfig.e2e.json.patch: -------------------------------------------------------------------------------- 1 | diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json 2 | index 1d9e5ed..73b1885 100644 3 | --- a/e2e/tsconfig.e2e.json 4 | +++ b/e2e/tsconfig.e2e.json 5 | @@ -10,5 +10,8 @@ 6 | "jasminewd2", 7 | "node" 8 | ] 9 | - } 10 | + }, 11 | + "exclude": [ 12 | + "../api/node_modules" 13 | + ] 14 | } 15 | -------------------------------------------------------------------------------- /patches/tsconfig.json.patch: -------------------------------------------------------------------------------- 1 | --- a/tsconfig.json 2017-09-11 10:26:15.387081984 +0200 2 | +++ b/tsconfig.json 2017-09-10 15:23:21.589934878 +0200 3 | @@ -3,11 +3,16 @@ 4 | "compilerOptions": { 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | + "baseUrl": ".", 8 | "declaration": false, 9 | + "module": "commonjs", 10 | "moduleResolution": "node", 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "target": "es5", 14 | + "skipLibCheck": true, 15 | + "stripInternal": true, 16 | + "noImplicitAny": false, 17 | "typeRoots": [ 18 | "node_modules/@types" 19 | ], 20 | @@ -15,5 +26,14 @@ 21 | "es2017", 22 | "dom" 23 | ] 24 | - } 25 | + }, 26 | + "include": [ 27 | + "src/**/*.ts", 28 | + "api/**/*.ts" 29 | + ], 30 | + "exclude": [ 31 | + "node_modules", 32 | + "api/node_modules", 33 | + "api" 34 | + ] 35 | } 36 | -------------------------------------------------------------------------------- /patches/tsconfig.spec.json.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json 2 | index 63d89ff..ba09457 100644 3 | --- a/src/tsconfig.spec.json 4 | +++ b/src/tsconfig.spec.json 5 | @@ -16,5 +16,8 @@ 6 | "include": [ 7 | "**/*.spec.ts", 8 | "**/*.d.ts" 9 | + ], 10 | + "exclude": [ 11 | + "../api/node_modules" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /patches/webpack.config.js.patch: -------------------------------------------------------------------------------- 1 | --- a/webpack.config.js 2017-11-03 19:41:59.847729765 +0100 2 | +++ b/webpack.config.js 2017-11-03 19:41:00.897727305 +0100 3 | @@ -1,5 +1,6 @@ 4 | const fs = require('fs'); 5 | const path = require('path'); 6 | +const webpack = require('webpack'); 7 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 8 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 9 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 10 | @@ -536,6 +537,9 @@ 11 | "main" 12 | ] 13 | }, 14 | + "externals": [ 15 | + resolveExternals 16 | + ], 17 | "resolveLoader": { 18 | "modules": [ 19 | "./node_modules", 20 | @@ -917,6 +921,9 @@ 21 | "tsConfigPath": "src/tsconfig.app.json", 22 | "skipCodeGeneration": true, 23 | "compilerOptions": {} 24 | + }), 25 | + new webpack.ProvidePlugin({ 26 | + __extends: 'typescript-extends' 27 | }) 28 | ], 29 | "node": { 30 | @@ -928,9 +935,25 @@ 31 | "process": true, 32 | "module": false, 33 | "clearImmediate": false, 34 | - "setImmediate": false 35 | + "setImmediate": false, 36 | + "__dirname": true 37 | }, 38 | "devServer": { 39 | "historyApiFallback": true 40 | } 41 | }; 42 | + 43 | +function resolveExternals(context, request, callback) { 44 | + return resolveMeteor(request, callback) || 45 | + callback(); 46 | +} 47 | + 48 | +function resolveMeteor(request, callback) { 49 | + var match = request.match(/^meteor\/(.+)$/); 50 | + var pack = match && match[1]; 51 | + 52 | + if (pack) { 53 | + callback(null, 'Package["' + pack + '"]'); 54 | + return true; 55 | + } 56 | +} 57 | -------------------------------------------------------------------------------- /patches/webpack.config.js.prod.patch: -------------------------------------------------------------------------------- 1 | --- a/webpack.config.js 2017-11-03 20:46:59.991225832 +0100 2 | +++ b/webpack.config.js 2017-11-03 20:46:36.494558186 +0100 3 | @@ -1,5 +1,6 @@ 4 | const fs = require('fs'); 5 | const path = require('path'); 6 | +const webpack = require('webpack'); 7 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 8 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 9 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 10 | @@ -539,6 +540,9 @@ 11 | "main" 12 | ] 13 | }, 14 | + "externals": [ 15 | + resolveExternals 16 | + ], 17 | "resolveLoader": { 18 | "modules": [ 19 | "./node_modules", 20 | @@ -985,6 +989,9 @@ 21 | "sourceMap": false, 22 | "tsConfigPath": "src/tsconfig.app.json", 23 | "compilerOptions": {} 24 | + }), 25 | + new webpack.ProvidePlugin({ 26 | + __extends: 'typescript-extends' 27 | }) 28 | ], 29 | "node": { 30 | @@ -996,9 +1003,25 @@ 31 | "process": true, 32 | "module": false, 33 | "clearImmediate": false, 34 | - "setImmediate": false 35 | + "setImmediate": false, 36 | + "__dirname": true 37 | }, 38 | "devServer": { 39 | "historyApiFallback": true 40 | } 41 | }; 42 | + 43 | +function resolveExternals(context, request, callback) { 44 | + return resolveMeteor(request, callback) || 45 | + callback(); 46 | +} 47 | + 48 | +function resolveMeteor(request, callback) { 49 | + var match = request.match(/^meteor\/(.+)$/); 50 | + var pack = match && match[1]; 51 | + 52 | + if (pack) { 53 | + callback(null, 'Package["' + pack + '"]'); 54 | + return true; 55 | + } 56 | +} 57 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome', 13 | chromeOptions: { 14 | args: [ '--headless', '--no-sandbox', '--disable-gpu', '--window-size=800x600' ] 15 | } 16 | }, 17 | directConnect: true, 18 | baseUrl: 'http://localhost:4200/', 19 | framework: 'jasmine', 20 | jasmineNodeOpts: { 21 | showColors: true, 22 | defaultTimeoutInterval: 30000, 23 | print: function() {} 24 | }, 25 | onPrepare() { 26 | require('ts-node').register({ 27 | project: 'e2e/tsconfig.e2e.json' 28 | }); 29 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 | Angular Logo 7 |
8 |

Here are some links to help you start:

9 | 20 |
{{chats | json}}
21 | 22 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbasic/angularcli-meteor/01bf4bfe991139ad81c006ff70b20d63068cc894/src/app/app.component.scss -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Chats } from '../../api/server/collections'; 3 | import { Chat } from '../../api/server/models'; 4 | 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.scss'] 10 | }) 11 | export class AppComponent implements OnInit { 12 | title = 'app'; 13 | chats: Chat[]; 14 | 15 | constructor() {} 16 | 17 | ngOnInit() { 18 | Chats.find({}).subscribe((chats: Chat[]) => { 19 | this.chats = chats; 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | 8 | @NgModule({ 9 | declarations: [ 10 | AppComponent 11 | ], 12 | imports: [ 13 | BrowserModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbasic/angularcli-meteor/01bf4bfe991139ad81c006ff70b20d63068cc894/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Declaration files are how the Typescript compiler knows about the type information(or shape) of an object. 3 | They're what make intellisense work and make Typescript know all about your code. 4 | A wildcard module is declared below to allow third party libraries to be used in an app even if they don't 5 | provide their own type declarations. 6 | To learn more about using third party libraries in an Ionic app, check out the docs here: 7 | http://ionicframework.com/docs/v2/resources/third-party-libs/ 8 | For more info on type definition files, check out the Typescript docs here: 9 | https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html 10 | */ 11 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbasic/angularcli-meteor/01bf4bfe991139ad81c006ff70b20d63068cc894/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularcliMeteor 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import 'meteor-client'; 2 | 3 | import { enableProdMode } from '@angular/core'; 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app/app.module'; 7 | import { environment } from './environments/environment'; 8 | 9 | if (environment.production) { 10 | enableProdMode(); 11 | } 12 | 13 | platformBrowserDynamic().bootstrapModule(AppModule) 14 | .catch(err => console.log(err)); 15 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | import 'meteor-client'; 15 | 16 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 17 | declare const __karma__: any; 18 | declare const require: any; 19 | 20 | // Prevent Karma from running prematurely. 21 | __karma__.loaded = function () {}; 22 | 23 | // First, initialize the Angular testing environment. 24 | getTestBed().initTestEnvironment( 25 | BrowserDynamicTestingModule, 26 | platformBrowserDynamicTesting() 27 | ); 28 | // Then we find all the tests. 29 | const context = require.context('./', true, /\.spec\.ts$/); 30 | // And load the modules. 31 | context.keys().map(context); 32 | // Finally, start Karma to run the tests. 33 | __karma__.start(); 34 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts", 12 | "../api/node_modules" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ], 20 | "exclude": [ 21 | "../api/node_modules" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "baseUrl": ".", 7 | "declaration": false, 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "skipLibCheck": true, 14 | "stripInternal": true, 15 | "noImplicitAny": false, 16 | "typeRoots": [ 17 | "node_modules/@types" 18 | ], 19 | "lib": [ 20 | "es2017", 21 | "dom" 22 | ] 23 | }, 24 | "include": [ 25 | "src/**/*.ts", 26 | "api/**/*.ts" 27 | ], 28 | "exclude": [ 29 | "node_modules", 30 | "api/node_modules", 31 | "api" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs", 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": [ 26 | true, 27 | "spaces" 28 | ], 29 | "interface-over-type-literal": true, 30 | "label-position": true, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-access": false, 36 | "member-ordering": [ 37 | true, 38 | { 39 | "order": [ 40 | "static-field", 41 | "instance-field", 42 | "static-method", 43 | "instance-method" 44 | ] 45 | } 46 | ], 47 | "no-arg": true, 48 | "no-bitwise": true, 49 | "no-console": [ 50 | true, 51 | "debug", 52 | "info", 53 | "time", 54 | "timeEnd", 55 | "trace" 56 | ], 57 | "no-construct": true, 58 | "no-debugger": true, 59 | "no-duplicate-super": true, 60 | "no-empty": false, 61 | "no-empty-interface": true, 62 | "no-eval": true, 63 | "no-inferrable-types": [ 64 | true, 65 | "ignore-params" 66 | ], 67 | "no-misused-new": true, 68 | "no-non-null-assertion": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "typeof-compare": true, 111 | "unified-signatures": true, 112 | "variable-name": false, 113 | "whitespace": [ 114 | true, 115 | "check-branch", 116 | "check-decl", 117 | "check-operator", 118 | "check-separator", 119 | "check-type" 120 | ], 121 | "directive-selector": [ 122 | true, 123 | "attribute", 124 | "app", 125 | "camelCase" 126 | ], 127 | "component-selector": [ 128 | true, 129 | "element", 130 | "app", 131 | "kebab-case" 132 | ], 133 | "no-output-on-prefix": true, 134 | "use-input-property-decorator": true, 135 | "use-output-property-decorator": true, 136 | "use-host-property-decorator": true, 137 | "no-input-rename": true, 138 | "no-output-rename": true, 139 | "use-life-cycle-interface": true, 140 | "use-pipe-transform-interface": true, 141 | "component-class-suffix": true, 142 | "directive-class-suffix": true 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | webpack.config.js.dev -------------------------------------------------------------------------------- /webpack.config.js.dev: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const webpack = require('webpack'); 4 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 5 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 6 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 7 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 8 | const rxPaths = require('rxjs/_esm5/path-mapping'); 9 | const autoprefixer = require('autoprefixer'); 10 | const postcssUrl = require('postcss-url'); 11 | const cssnano = require('cssnano'); 12 | const customProperties = require('postcss-custom-properties'); 13 | 14 | const { NoEmitOnErrorsPlugin, SourceMapDevToolPlugin, NamedModulesPlugin } = require('webpack'); 15 | const { NamedLazyChunksWebpackPlugin, BaseHrefWebpackPlugin } = require('@angular/cli/plugins/webpack'); 16 | const { CommonsChunkPlugin } = require('webpack').optimize; 17 | const { AngularCompilerPlugin } = require('@ngtools/webpack'); 18 | 19 | const nodeModules = path.join(process.cwd(), 'node_modules'); 20 | const realNodeModules = fs.realpathSync(nodeModules); 21 | const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules'); 22 | const entryPoints = ["inline","polyfills","sw-register","styles","vendor","main"]; 23 | const minimizeCss = false; 24 | const baseHref = ""; 25 | const deployUrl = ""; 26 | const postcssPlugins = function () { 27 | // safe settings based on: https://github.com/ben-eb/cssnano/issues/358#issuecomment-283696193 28 | const importantCommentRe = /@preserve|@licen[cs]e|[@#]\s*source(?:Mapping)?URL|^!/i; 29 | const minimizeOptions = { 30 | autoprefixer: false, 31 | safe: true, 32 | mergeLonghand: false, 33 | discardComments: { remove: (comment) => !importantCommentRe.test(comment) } 34 | }; 35 | return [ 36 | postcssUrl([ 37 | { 38 | // Only convert root relative URLs, which CSS-Loader won't process into require(). 39 | filter: ({ url }) => url.startsWith('/') && !url.startsWith('//'), 40 | url: ({ url }) => { 41 | if (deployUrl.match(/:\/\//)) { 42 | // If deployUrl contains a scheme, ignore baseHref use deployUrl as is. 43 | return `${deployUrl.replace(/\/$/, '')}${url}`; 44 | } 45 | else if (baseHref.match(/:\/\//)) { 46 | // If baseHref contains a scheme, include it as is. 47 | return baseHref.replace(/\/$/, '') + 48 | `/${deployUrl}/${url}`.replace(/\/\/+/g, '/'); 49 | } 50 | else { 51 | // Join together base-href, deploy-url and the original URL. 52 | // Also dedupe multiple slashes into single ones. 53 | return `/${baseHref}/${deployUrl}/${url}`.replace(/\/\/+/g, '/'); 54 | } 55 | } 56 | }, 57 | { 58 | // TODO: inline .cur if not supporting IE (use browserslist to check) 59 | filter: (asset) => !asset.hash && !asset.absolutePath.endsWith('.cur'), 60 | url: 'inline', 61 | // NOTE: maxSize is in KB 62 | maxSize: 10 63 | } 64 | ]), 65 | autoprefixer(), 66 | customProperties({ preserve: true }) 67 | ].concat(minimizeCss ? [cssnano(minimizeOptions)] : []); 68 | }; 69 | 70 | 71 | 72 | 73 | module.exports = { 74 | "resolve": { 75 | "extensions": [ 76 | ".ts", 77 | ".js" 78 | ], 79 | "modules": [ 80 | "./node_modules", 81 | "./node_modules" 82 | ], 83 | "symlinks": true, 84 | "alias": rxPaths(), 85 | "mainFields": [ 86 | "browser", 87 | "module", 88 | "main" 89 | ] 90 | }, 91 | "externals": [ 92 | resolveExternals 93 | ], 94 | "resolveLoader": { 95 | "modules": [ 96 | "./node_modules", 97 | "./node_modules" 98 | ], 99 | "alias": rxPaths() 100 | }, 101 | "entry": { 102 | "main": [ 103 | "./src/main.ts" 104 | ], 105 | "polyfills": [ 106 | "./src/polyfills.ts" 107 | ], 108 | "styles": [ 109 | "./src/styles.scss" 110 | ] 111 | }, 112 | "output": { 113 | "path": path.join(process.cwd(), "dist"), 114 | "filename": "[name].bundle.js", 115 | "chunkFilename": "[id].chunk.js", 116 | "crossOriginLoading": false 117 | }, 118 | "module": { 119 | "rules": [ 120 | { 121 | "test": /\.html$/, 122 | "loader": "raw-loader" 123 | }, 124 | { 125 | "test": /\.(eot|svg|cur)$/, 126 | "loader": "file-loader", 127 | "options": { 128 | "name": "[name].[hash:20].[ext]", 129 | "limit": 10000 130 | } 131 | }, 132 | { 133 | "test": /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/, 134 | "loader": "url-loader", 135 | "options": { 136 | "name": "[name].[hash:20].[ext]", 137 | "limit": 10000 138 | } 139 | }, 140 | { 141 | "exclude": [ 142 | path.join(process.cwd(), "src/styles.scss") 143 | ], 144 | "test": /\.css$/, 145 | "use": [ 146 | "exports-loader?module.exports.toString()", 147 | { 148 | "loader": "css-loader", 149 | "options": { 150 | "sourceMap": false, 151 | "importLoaders": 1 152 | } 153 | }, 154 | { 155 | "loader": "postcss-loader", 156 | "options": { 157 | "ident": "postcss", 158 | "plugins": postcssPlugins, 159 | "sourceMap": false 160 | } 161 | } 162 | ] 163 | }, 164 | { 165 | "exclude": [ 166 | path.join(process.cwd(), "src/styles.scss") 167 | ], 168 | "test": /\.scss$|\.sass$/, 169 | "use": [ 170 | "exports-loader?module.exports.toString()", 171 | { 172 | "loader": "css-loader", 173 | "options": { 174 | "sourceMap": false, 175 | "importLoaders": 1 176 | } 177 | }, 178 | { 179 | "loader": "postcss-loader", 180 | "options": { 181 | "ident": "postcss", 182 | "plugins": postcssPlugins, 183 | "sourceMap": false 184 | } 185 | }, 186 | { 187 | "loader": "sass-loader", 188 | "options": { 189 | "sourceMap": false, 190 | "precision": 8, 191 | "includePaths": [] 192 | } 193 | } 194 | ] 195 | }, 196 | { 197 | "exclude": [ 198 | path.join(process.cwd(), "src/styles.scss") 199 | ], 200 | "test": /\.less$/, 201 | "use": [ 202 | "exports-loader?module.exports.toString()", 203 | { 204 | "loader": "css-loader", 205 | "options": { 206 | "sourceMap": false, 207 | "importLoaders": 1 208 | } 209 | }, 210 | { 211 | "loader": "postcss-loader", 212 | "options": { 213 | "ident": "postcss", 214 | "plugins": postcssPlugins, 215 | "sourceMap": false 216 | } 217 | }, 218 | { 219 | "loader": "less-loader", 220 | "options": { 221 | "sourceMap": false 222 | } 223 | } 224 | ] 225 | }, 226 | { 227 | "exclude": [ 228 | path.join(process.cwd(), "src/styles.scss") 229 | ], 230 | "test": /\.styl$/, 231 | "use": [ 232 | "exports-loader?module.exports.toString()", 233 | { 234 | "loader": "css-loader", 235 | "options": { 236 | "sourceMap": false, 237 | "importLoaders": 1 238 | } 239 | }, 240 | { 241 | "loader": "postcss-loader", 242 | "options": { 243 | "ident": "postcss", 244 | "plugins": postcssPlugins, 245 | "sourceMap": false 246 | } 247 | }, 248 | { 249 | "loader": "stylus-loader", 250 | "options": { 251 | "sourceMap": false, 252 | "paths": [] 253 | } 254 | } 255 | ] 256 | }, 257 | { 258 | "include": [ 259 | path.join(process.cwd(), "src/styles.scss") 260 | ], 261 | "test": /\.css$/, 262 | "use": [ 263 | "style-loader", 264 | { 265 | "loader": "css-loader", 266 | "options": { 267 | "sourceMap": false, 268 | "importLoaders": 1 269 | } 270 | }, 271 | { 272 | "loader": "postcss-loader", 273 | "options": { 274 | "ident": "postcss", 275 | "plugins": postcssPlugins, 276 | "sourceMap": false 277 | } 278 | } 279 | ] 280 | }, 281 | { 282 | "include": [ 283 | path.join(process.cwd(), "src/styles.scss") 284 | ], 285 | "test": /\.scss$|\.sass$/, 286 | "use": [ 287 | "style-loader", 288 | { 289 | "loader": "css-loader", 290 | "options": { 291 | "sourceMap": false, 292 | "importLoaders": 1 293 | } 294 | }, 295 | { 296 | "loader": "postcss-loader", 297 | "options": { 298 | "ident": "postcss", 299 | "plugins": postcssPlugins, 300 | "sourceMap": false 301 | } 302 | }, 303 | { 304 | "loader": "sass-loader", 305 | "options": { 306 | "sourceMap": false, 307 | "precision": 8, 308 | "includePaths": [] 309 | } 310 | } 311 | ] 312 | }, 313 | { 314 | "include": [ 315 | path.join(process.cwd(), "src/styles.scss") 316 | ], 317 | "test": /\.less$/, 318 | "use": [ 319 | "style-loader", 320 | { 321 | "loader": "css-loader", 322 | "options": { 323 | "sourceMap": false, 324 | "importLoaders": 1 325 | } 326 | }, 327 | { 328 | "loader": "postcss-loader", 329 | "options": { 330 | "ident": "postcss", 331 | "plugins": postcssPlugins, 332 | "sourceMap": false 333 | } 334 | }, 335 | { 336 | "loader": "less-loader", 337 | "options": { 338 | "sourceMap": false 339 | } 340 | } 341 | ] 342 | }, 343 | { 344 | "include": [ 345 | path.join(process.cwd(), "src/styles.scss") 346 | ], 347 | "test": /\.styl$/, 348 | "use": [ 349 | "style-loader", 350 | { 351 | "loader": "css-loader", 352 | "options": { 353 | "sourceMap": false, 354 | "importLoaders": 1 355 | } 356 | }, 357 | { 358 | "loader": "postcss-loader", 359 | "options": { 360 | "ident": "postcss", 361 | "plugins": postcssPlugins, 362 | "sourceMap": false 363 | } 364 | }, 365 | { 366 | "loader": "stylus-loader", 367 | "options": { 368 | "sourceMap": false, 369 | "paths": [] 370 | } 371 | } 372 | ] 373 | }, 374 | { 375 | "test": /\.ts$/, 376 | "loader": "@ngtools/webpack" 377 | } 378 | ] 379 | }, 380 | "plugins": [ 381 | new NoEmitOnErrorsPlugin(), 382 | new CopyWebpackPlugin([ 383 | { 384 | "context": "src", 385 | "to": "", 386 | "from": { 387 | "glob": "assets/**/*", 388 | "dot": true 389 | } 390 | }, 391 | { 392 | "context": "src", 393 | "to": "", 394 | "from": { 395 | "glob": "favicon.ico", 396 | "dot": true 397 | } 398 | } 399 | ], { 400 | "ignore": [ 401 | ".gitkeep", 402 | "**/.DS_Store", 403 | "**/Thumbs.db" 404 | ], 405 | "debug": "warning" 406 | }), 407 | new ProgressPlugin(), 408 | new CircularDependencyPlugin({ 409 | "exclude": /(\\|\/)node_modules(\\|\/)/, 410 | "failOnError": false, 411 | "onDetected": false, 412 | "cwd": "/home/niko/WebstormProjects/angularcli-meteor" 413 | }), 414 | new NamedLazyChunksWebpackPlugin(), 415 | new HtmlWebpackPlugin({ 416 | "template": "./src/index.html", 417 | "filename": "./index.html", 418 | "hash": false, 419 | "inject": true, 420 | "compile": true, 421 | "favicon": false, 422 | "minify": false, 423 | "cache": true, 424 | "showErrors": true, 425 | "chunks": "all", 426 | "excludeChunks": [], 427 | "title": "Webpack App", 428 | "xhtml": true, 429 | "chunksSortMode": function sort(left, right) { 430 | let leftIndex = entryPoints.indexOf(left.names[0]); 431 | let rightindex = entryPoints.indexOf(right.names[0]); 432 | if (leftIndex > rightindex) { 433 | return 1; 434 | } 435 | else if (leftIndex < rightindex) { 436 | return -1; 437 | } 438 | else { 439 | return 0; 440 | } 441 | } 442 | }), 443 | new BaseHrefWebpackPlugin({}), 444 | new CommonsChunkPlugin({ 445 | "name": [ 446 | "inline" 447 | ], 448 | "minChunks": null 449 | }), 450 | new CommonsChunkPlugin({ 451 | "name": [ 452 | "vendor" 453 | ], 454 | "minChunks": (module) => { 455 | return module.resource 456 | && (module.resource.startsWith(nodeModules) 457 | || module.resource.startsWith(genDirNodeModules) 458 | || module.resource.startsWith(realNodeModules)); 459 | }, 460 | "chunks": [ 461 | "main" 462 | ] 463 | }), 464 | new SourceMapDevToolPlugin({ 465 | "filename": "[file].map[query]", 466 | "moduleFilenameTemplate": "[resource-path]", 467 | "fallbackModuleFilenameTemplate": "[resource-path]?[hash]", 468 | "sourceRoot": "webpack:///" 469 | }), 470 | new CommonsChunkPlugin({ 471 | "name": [ 472 | "main" 473 | ], 474 | "minChunks": 2, 475 | "async": "common" 476 | }), 477 | new NamedModulesPlugin({}), 478 | new AngularCompilerPlugin({ 479 | "mainPath": "main.ts", 480 | "platform": 0, 481 | "hostReplacementPaths": { 482 | "environments/environment.ts": "environments/environment.ts" 483 | }, 484 | "sourceMap": true, 485 | "tsConfigPath": "src/tsconfig.app.json", 486 | "skipCodeGeneration": true, 487 | "compilerOptions": {} 488 | }), 489 | new webpack.ProvidePlugin({ 490 | __extends: 'typescript-extends' 491 | }) 492 | ], 493 | "node": { 494 | "fs": "empty", 495 | "global": true, 496 | "crypto": "empty", 497 | "tls": "empty", 498 | "net": "empty", 499 | "process": true, 500 | "module": false, 501 | "clearImmediate": false, 502 | "setImmediate": false, 503 | "__dirname": true 504 | }, 505 | "devServer": { 506 | "historyApiFallback": true 507 | } 508 | }; 509 | 510 | function resolveExternals(context, request, callback) { 511 | return resolveMeteor(request, callback) || 512 | callback(); 513 | } 514 | 515 | function resolveMeteor(request, callback) { 516 | var match = request.match(/^meteor\/(.+)$/); 517 | var pack = match && match[1]; 518 | 519 | if (pack) { 520 | callback(null, 'Package["' + pack + '"]'); 521 | return true; 522 | } 523 | } 524 | -------------------------------------------------------------------------------- /webpack.config.js.prod: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const webpack = require('webpack'); 4 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 5 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 6 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 7 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 8 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 9 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); 10 | const rxPaths = require('rxjs/_esm5/path-mapping'); 11 | const autoprefixer = require('autoprefixer'); 12 | const postcssUrl = require('postcss-url'); 13 | const cssnano = require('cssnano'); 14 | const customProperties = require('postcss-custom-properties'); 15 | 16 | const { NoEmitOnErrorsPlugin, EnvironmentPlugin, HashedModuleIdsPlugin } = require('webpack'); 17 | const { BaseHrefWebpackPlugin, SuppressExtractedTextChunksWebpackPlugin } = require('@angular/cli/plugins/webpack'); 18 | const { CommonsChunkPlugin, ModuleConcatenationPlugin } = require('webpack').optimize; 19 | const { LicenseWebpackPlugin } = require('license-webpack-plugin'); 20 | const { PurifyPlugin } = require('@angular-devkit/build-optimizer'); 21 | const { AngularCompilerPlugin } = require('@ngtools/webpack'); 22 | 23 | const nodeModules = path.join(process.cwd(), 'node_modules'); 24 | const realNodeModules = fs.realpathSync(nodeModules); 25 | const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules'); 26 | const entryPoints = ["inline","polyfills","sw-register","styles","vendor","main"]; 27 | const minimizeCss = true; 28 | const baseHref = ""; 29 | const deployUrl = ""; 30 | const postcssPlugins = function () { 31 | // safe settings based on: https://github.com/ben-eb/cssnano/issues/358#issuecomment-283696193 32 | const importantCommentRe = /@preserve|@licen[cs]e|[@#]\s*source(?:Mapping)?URL|^!/i; 33 | const minimizeOptions = { 34 | autoprefixer: false, 35 | safe: true, 36 | mergeLonghand: false, 37 | discardComments: { remove: (comment) => !importantCommentRe.test(comment) } 38 | }; 39 | return [ 40 | postcssUrl([ 41 | { 42 | // Only convert root relative URLs, which CSS-Loader won't process into require(). 43 | filter: ({ url }) => url.startsWith('/') && !url.startsWith('//'), 44 | url: ({ url }) => { 45 | if (deployUrl.match(/:\/\//)) { 46 | // If deployUrl contains a scheme, ignore baseHref use deployUrl as is. 47 | return `${deployUrl.replace(/\/$/, '')}${url}`; 48 | } 49 | else if (baseHref.match(/:\/\//)) { 50 | // If baseHref contains a scheme, include it as is. 51 | return baseHref.replace(/\/$/, '') + 52 | `/${deployUrl}/${url}`.replace(/\/\/+/g, '/'); 53 | } 54 | else { 55 | // Join together base-href, deploy-url and the original URL. 56 | // Also dedupe multiple slashes into single ones. 57 | return `/${baseHref}/${deployUrl}/${url}`.replace(/\/\/+/g, '/'); 58 | } 59 | } 60 | }, 61 | { 62 | // TODO: inline .cur if not supporting IE (use browserslist to check) 63 | filter: (asset) => !asset.hash && !asset.absolutePath.endsWith('.cur'), 64 | url: 'inline', 65 | // NOTE: maxSize is in KB 66 | maxSize: 10 67 | } 68 | ]), 69 | autoprefixer(), 70 | customProperties({ preserve: true }) 71 | ].concat(minimizeCss ? [cssnano(minimizeOptions)] : []); 72 | }; 73 | 74 | 75 | 76 | 77 | module.exports = { 78 | "resolve": { 79 | "extensions": [ 80 | ".ts", 81 | ".js" 82 | ], 83 | "modules": [ 84 | "./node_modules", 85 | "./node_modules" 86 | ], 87 | "symlinks": true, 88 | "alias": rxPaths(), 89 | "mainFields": [ 90 | "browser", 91 | "module", 92 | "main" 93 | ] 94 | }, 95 | "externals": [ 96 | resolveExternals 97 | ], 98 | "resolveLoader": { 99 | "modules": [ 100 | "./node_modules", 101 | "./node_modules" 102 | ], 103 | "alias": rxPaths() 104 | }, 105 | "entry": { 106 | "main": [ 107 | "./src/main.ts" 108 | ], 109 | "polyfills": [ 110 | "./src/polyfills.ts" 111 | ], 112 | "styles": [ 113 | "./src/styles.scss" 114 | ] 115 | }, 116 | "output": { 117 | "path": path.join(process.cwd(), "dist"), 118 | "filename": "[name].[chunkhash:20].bundle.js", 119 | "chunkFilename": "[id].[chunkhash:20].chunk.js", 120 | "crossOriginLoading": false 121 | }, 122 | "module": { 123 | "rules": [ 124 | { 125 | "test": /\.html$/, 126 | "loader": "raw-loader" 127 | }, 128 | { 129 | "test": /\.(eot|svg|cur)$/, 130 | "loader": "file-loader", 131 | "options": { 132 | "name": "[name].[hash:20].[ext]", 133 | "limit": 10000 134 | } 135 | }, 136 | { 137 | "test": /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/, 138 | "loader": "url-loader", 139 | "options": { 140 | "name": "[name].[hash:20].[ext]", 141 | "limit": 10000 142 | } 143 | }, 144 | { 145 | "test": /\.js$/, 146 | "use": [ 147 | { 148 | "loader": "@angular-devkit/build-optimizer/webpack-loader", 149 | "options": { 150 | "sourceMap": false 151 | } 152 | } 153 | ] 154 | }, 155 | { 156 | "exclude": [ 157 | path.join(process.cwd(), "src/styles.scss") 158 | ], 159 | "test": /\.css$/, 160 | "use": [ 161 | "exports-loader?module.exports.toString()", 162 | { 163 | "loader": "css-loader", 164 | "options": { 165 | "sourceMap": false, 166 | "importLoaders": 1 167 | } 168 | }, 169 | { 170 | "loader": "postcss-loader", 171 | "options": { 172 | "ident": "postcss", 173 | "plugins": postcssPlugins, 174 | "sourceMap": false 175 | } 176 | } 177 | ] 178 | }, 179 | { 180 | "exclude": [ 181 | path.join(process.cwd(), "src/styles.scss") 182 | ], 183 | "test": /\.scss$|\.sass$/, 184 | "use": [ 185 | "exports-loader?module.exports.toString()", 186 | { 187 | "loader": "css-loader", 188 | "options": { 189 | "sourceMap": false, 190 | "importLoaders": 1 191 | } 192 | }, 193 | { 194 | "loader": "postcss-loader", 195 | "options": { 196 | "ident": "postcss", 197 | "plugins": postcssPlugins, 198 | "sourceMap": false 199 | } 200 | }, 201 | { 202 | "loader": "sass-loader", 203 | "options": { 204 | "sourceMap": false, 205 | "precision": 8, 206 | "includePaths": [] 207 | } 208 | } 209 | ] 210 | }, 211 | { 212 | "exclude": [ 213 | path.join(process.cwd(), "src/styles.scss") 214 | ], 215 | "test": /\.less$/, 216 | "use": [ 217 | "exports-loader?module.exports.toString()", 218 | { 219 | "loader": "css-loader", 220 | "options": { 221 | "sourceMap": false, 222 | "importLoaders": 1 223 | } 224 | }, 225 | { 226 | "loader": "postcss-loader", 227 | "options": { 228 | "ident": "postcss", 229 | "plugins": postcssPlugins, 230 | "sourceMap": false 231 | } 232 | }, 233 | { 234 | "loader": "less-loader", 235 | "options": { 236 | "sourceMap": false 237 | } 238 | } 239 | ] 240 | }, 241 | { 242 | "exclude": [ 243 | path.join(process.cwd(), "src/styles.scss") 244 | ], 245 | "test": /\.styl$/, 246 | "use": [ 247 | "exports-loader?module.exports.toString()", 248 | { 249 | "loader": "css-loader", 250 | "options": { 251 | "sourceMap": false, 252 | "importLoaders": 1 253 | } 254 | }, 255 | { 256 | "loader": "postcss-loader", 257 | "options": { 258 | "ident": "postcss", 259 | "plugins": postcssPlugins, 260 | "sourceMap": false 261 | } 262 | }, 263 | { 264 | "loader": "stylus-loader", 265 | "options": { 266 | "sourceMap": false, 267 | "paths": [] 268 | } 269 | } 270 | ] 271 | }, 272 | { 273 | "include": [ 274 | path.join(process.cwd(), "src/styles.scss") 275 | ], 276 | "test": /\.css$/, 277 | "loaders": ExtractTextPlugin.extract({ 278 | "use": [ 279 | { 280 | "loader": "css-loader", 281 | "options": { 282 | "sourceMap": false, 283 | "importLoaders": 1 284 | } 285 | }, 286 | { 287 | "loader": "postcss-loader", 288 | "options": { 289 | "ident": "postcss", 290 | "plugins": postcssPlugins, 291 | "sourceMap": false 292 | } 293 | } 294 | ], 295 | "publicPath": "" 296 | }) 297 | }, 298 | { 299 | "include": [ 300 | path.join(process.cwd(), "src/styles.scss") 301 | ], 302 | "test": /\.scss$|\.sass$/, 303 | "loaders": ExtractTextPlugin.extract({ 304 | "use": [ 305 | { 306 | "loader": "css-loader", 307 | "options": { 308 | "sourceMap": false, 309 | "importLoaders": 1 310 | } 311 | }, 312 | { 313 | "loader": "postcss-loader", 314 | "options": { 315 | "ident": "postcss", 316 | "plugins": postcssPlugins, 317 | "sourceMap": false 318 | } 319 | }, 320 | { 321 | "loader": "sass-loader", 322 | "options": { 323 | "sourceMap": false, 324 | "precision": 8, 325 | "includePaths": [] 326 | } 327 | } 328 | ], 329 | "publicPath": "" 330 | }) 331 | }, 332 | { 333 | "include": [ 334 | path.join(process.cwd(), "src/styles.scss") 335 | ], 336 | "test": /\.less$/, 337 | "loaders": ExtractTextPlugin.extract({ 338 | "use": [ 339 | { 340 | "loader": "css-loader", 341 | "options": { 342 | "sourceMap": false, 343 | "importLoaders": 1 344 | } 345 | }, 346 | { 347 | "loader": "postcss-loader", 348 | "options": { 349 | "ident": "postcss", 350 | "plugins": postcssPlugins, 351 | "sourceMap": false 352 | } 353 | }, 354 | { 355 | "loader": "less-loader", 356 | "options": { 357 | "sourceMap": false 358 | } 359 | } 360 | ], 361 | "publicPath": "" 362 | }) 363 | }, 364 | { 365 | "include": [ 366 | path.join(process.cwd(), "src/styles.scss") 367 | ], 368 | "test": /\.styl$/, 369 | "loaders": ExtractTextPlugin.extract({ 370 | "use": [ 371 | { 372 | "loader": "css-loader", 373 | "options": { 374 | "sourceMap": false, 375 | "importLoaders": 1 376 | } 377 | }, 378 | { 379 | "loader": "postcss-loader", 380 | "options": { 381 | "ident": "postcss", 382 | "plugins": postcssPlugins, 383 | "sourceMap": false 384 | } 385 | }, 386 | { 387 | "loader": "stylus-loader", 388 | "options": { 389 | "sourceMap": false, 390 | "paths": [] 391 | } 392 | } 393 | ], 394 | "publicPath": "" 395 | }) 396 | }, 397 | { 398 | "test": /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, 399 | "use": [ 400 | { 401 | "loader": "@angular-devkit/build-optimizer/webpack-loader", 402 | "options": { 403 | "sourceMap": false 404 | } 405 | }, 406 | "@ngtools/webpack" 407 | ] 408 | } 409 | ] 410 | }, 411 | "plugins": [ 412 | new NoEmitOnErrorsPlugin(), 413 | new CopyWebpackPlugin([ 414 | { 415 | "context": "src", 416 | "to": "", 417 | "from": { 418 | "glob": "assets/**/*", 419 | "dot": true 420 | } 421 | }, 422 | { 423 | "context": "src", 424 | "to": "", 425 | "from": { 426 | "glob": "favicon.ico", 427 | "dot": true 428 | } 429 | } 430 | ], { 431 | "ignore": [ 432 | ".gitkeep", 433 | "**/.DS_Store", 434 | "**/Thumbs.db" 435 | ], 436 | "debug": "warning" 437 | }), 438 | new ProgressPlugin(), 439 | new CircularDependencyPlugin({ 440 | "exclude": /(\\|\/)node_modules(\\|\/)/, 441 | "failOnError": false, 442 | "onDetected": false, 443 | "cwd": "/home/niko/WebstormProjects/angularcli-meteor" 444 | }), 445 | new HtmlWebpackPlugin({ 446 | "template": "./src/index.html", 447 | "filename": "./index.html", 448 | "hash": false, 449 | "inject": true, 450 | "compile": true, 451 | "favicon": false, 452 | "minify": { 453 | "caseSensitive": true, 454 | "collapseWhitespace": true, 455 | "keepClosingSlash": true 456 | }, 457 | "cache": true, 458 | "showErrors": true, 459 | "chunks": "all", 460 | "excludeChunks": [], 461 | "title": "Webpack App", 462 | "xhtml": true, 463 | "chunksSortMode": function sort(left, right) { 464 | let leftIndex = entryPoints.indexOf(left.names[0]); 465 | let rightindex = entryPoints.indexOf(right.names[0]); 466 | if (leftIndex > rightindex) { 467 | return 1; 468 | } 469 | else if (leftIndex < rightindex) { 470 | return -1; 471 | } 472 | else { 473 | return 0; 474 | } 475 | } 476 | }), 477 | new BaseHrefWebpackPlugin({}), 478 | new CommonsChunkPlugin({ 479 | "name": [ 480 | "inline" 481 | ], 482 | "minChunks": null 483 | }), 484 | new CommonsChunkPlugin({ 485 | "name": [ 486 | "main" 487 | ], 488 | "minChunks": 2, 489 | "async": "common" 490 | }), 491 | new ExtractTextPlugin({ 492 | "filename": "[name].[contenthash:20].bundle.css" 493 | }), 494 | new SuppressExtractedTextChunksWebpackPlugin(), 495 | new EnvironmentPlugin({ 496 | "NODE_ENV": "production" 497 | }), 498 | new HashedModuleIdsPlugin({ 499 | "hashFunction": "md5", 500 | "hashDigest": "base64", 501 | "hashDigestLength": 4 502 | }), 503 | new ModuleConcatenationPlugin({}), 504 | new LicenseWebpackPlugin({ 505 | "licenseFilenames": [ 506 | "LICENSE", 507 | "LICENSE.md", 508 | "LICENSE.txt", 509 | "license", 510 | "license.md", 511 | "license.txt" 512 | ], 513 | "perChunkOutput": false, 514 | "outputTemplate": "/home/niko/WebstormProjects/angularcli-meteor/node_modules/license-webpack-plugin/output.template.ejs", 515 | "outputFilename": "3rdpartylicenses.txt", 516 | "suppressErrors": true, 517 | "includePackagesWithoutLicense": false, 518 | "abortOnUnacceptableLicense": false, 519 | "addBanner": false, 520 | "bannerTemplate": "/*! 3rd party license information is available at <%- filename %> */", 521 | "includedChunks": [], 522 | "excludedChunks": [], 523 | "additionalPackages": [], 524 | "pattern": /^(MIT|ISC|BSD.*)$/ 525 | }), 526 | new PurifyPlugin(), 527 | new UglifyJsPlugin({ 528 | "test": /\.js$/i, 529 | "extractComments": false, 530 | "sourceMap": false, 531 | "cache": false, 532 | "parallel": false, 533 | "uglifyOptions": { 534 | "output": { 535 | "ascii_only": true, 536 | "comments": false, 537 | "webkit": true 538 | }, 539 | "ecma": 5, 540 | "warnings": false, 541 | "ie8": false, 542 | "mangle": { 543 | "safari10": true 544 | }, 545 | "compress": { 546 | "typeofs": false, 547 | "pure_getters": true, 548 | "passes": 3 549 | } 550 | } 551 | }), 552 | new AngularCompilerPlugin({ 553 | "mainPath": "main.ts", 554 | "platform": 0, 555 | "hostReplacementPaths": { 556 | "environments/environment.ts": "environments/environment.prod.ts" 557 | }, 558 | "sourceMap": false, 559 | "tsConfigPath": "src/tsconfig.app.json", 560 | "compilerOptions": {} 561 | }), 562 | new webpack.ProvidePlugin({ 563 | __extends: 'typescript-extends' 564 | }) 565 | ], 566 | "node": { 567 | "fs": "empty", 568 | "global": true, 569 | "crypto": "empty", 570 | "tls": "empty", 571 | "net": "empty", 572 | "process": true, 573 | "module": false, 574 | "clearImmediate": false, 575 | "setImmediate": false, 576 | "__dirname": true 577 | }, 578 | "devServer": { 579 | "historyApiFallback": true 580 | } 581 | }; 582 | 583 | function resolveExternals(context, request, callback) { 584 | return resolveMeteor(request, callback) || 585 | callback(); 586 | } 587 | 588 | function resolveMeteor(request, callback) { 589 | var match = request.match(/^meteor\/(.+)$/); 590 | var pack = match && match[1]; 591 | 592 | if (pack) { 593 | callback(null, 'Package["' + pack + '"]'); 594 | return true; 595 | } 596 | } 597 | --------------------------------------------------------------------------------