├── .gitignore ├── Gulpfile.js ├── README.md ├── client ├── app │ └── app.js └── index.html ├── package.json └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | DS_Store 4 | dist 5 | client/lib 6 | -------------------------------------------------------------------------------- /Gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var sync = require('run-sequence'); 3 | var browser = require('browser-sync'); 4 | var webpack = require('webpack-stream'); 5 | var todo = require('gulp-todoist'); 6 | 7 | /* 8 | map of paths for using with the tasks below 9 | */ 10 | var paths = { 11 | entry: 'client/app/app.js', 12 | app: ['client/app/**/*.{js,styl,html}'], 13 | js: 'client/app/**/*!(.spec.js).js', 14 | styl: 'client/app/**/*.styl', 15 | toCopy: ['client/index.html'], 16 | html: ['client/index.html', 'client/app/**/*.html'], 17 | dest: 'dist' 18 | }; 19 | 20 | gulp.task('todo', function() { 21 | return gulp.src(paths.js) 22 | .pipe(todo({silent: false, verbose: true})); 23 | }); 24 | 25 | gulp.task('build', ['todo'], function() { 26 | //TODO 27 | /* 28 | fill this task out to take in entry file 29 | and build using the webpack plugin. 30 | the plugin takes the webpack.config as an arg. 31 | be sure to stream the result to the destination path 32 | */ 33 | }); 34 | 35 | gulp.task('serve', function() { 36 | browser({ 37 | port: process.env.PORT || 4500, 38 | open: false, 39 | ghostMode: false, 40 | server: { 41 | baseDir: 'dist' 42 | } 43 | }); 44 | }); 45 | 46 | /* 47 | simple task to copy over needed files to dist 48 | */ 49 | gulp.task('copy', function() { 50 | return gulp.src(paths.toCopy, { base: 'client' }) 51 | .pipe(gulp.dest(paths.dest)); 52 | }); 53 | 54 | /* 55 | task to watch files for changes and call build and copy tasks 56 | */ 57 | gulp.task('watch', function() { 58 | gulp.watch(paths.app, ['build', browser.reload]); 59 | gulp.watch(paths.toCopy, ['copy']); 60 | }); 61 | 62 | gulp.task('default', function(done) { 63 | sync('build', 'copy', 'serve', 'watch', done) 64 | }); 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > [!NOTE] 2 | > This repo is from an archived version of the course. Watch the latest version of the course on [frontendmasters.com](https://frontendmasters.com/courses/angular-fundamentals/). 3 | 4 | # angular-components 5 | 6 | This repository's steps are in the branches. The final branch is "blog". 7 | 8 | To get on the correct branch use this command, replacing BRANCH with the branch you want to switch to. 9 | 10 | ``` 11 | git checkout -b BRANCH origin/BRANCH 12 | ``` 13 | -------------------------------------------------------------------------------- /client/app/app.js: -------------------------------------------------------------------------------- 1 | const showMessage = ()=> { 2 | alert('it works!!!'); 3 | } 4 | 5 | showMessage(); 6 | 7 | -------------------------------------------------------------------------------- /client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |