Compare commits

...

10 Commits

Author SHA1 Message Date
jason.zhu 8a17a93a5f Uglifying JavaScript 2021-03-23 01:17:53 +00:00
jason.zhu d05b27190e Merge branch 'master' of ssh://lj918plus.dsmynas.com:2223/Jason/grunt-playlist 2021-03-23 12:05:38 +11:00
jason.zhu acf6665056 Grunt JS Tutorial #5 - Compiling SASS
1. Installed node-sass grunt-sass
2. Added `const sass = require('node-sass');
3. Added initConfig

Note: SASS to CSS is not successful, has to deal with it later
2021-03-23 01:05:04 +00:00
jason.zhu 818ab93deb Grunt JS Tutorial #5 - Compiling SASS
1. Installed node-sass grunt-sass
2. Added `const sass = require('node-sass');
3. Added initConfig
2021-03-23 01:03:26 +00:00
jason.zhu 721f114286 Grunt JS Tutorial #4 - Adding a Plugin (concatenating files)
1. Installed concat plugin
2. Modified config to have plugin
2021-03-23 00:28:46 +00:00
jason.zhu 96dec97cd4 Grunt JS Tutorial #3 - Creating a Gruntfile.js
1. Add config
2. Load plugins
3. Register tasks

Additional: uninstalled grunt-cli from local node-module, and installed it locally to use it
2021-03-22 23:58:45 +00:00
jason.zhu dc1211b968 GruntJS Tutorial #2 - Installing Grunt.js 2021-03-22 23:47:59 +00:00
jason.zhu 070512eae2 Modified .gitignore 2021-03-23 10:28:04 +11:00
jason.zhu 604706022d Added dev container file forr vscode 2021-03-22 23:17:38 +00:00
jason.zhu c5f3532d84 My first commit 2021-03-23 10:14:02 +11:00
8 changed files with 3770 additions and 21 deletions

View File

@ -0,0 +1,16 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/javascript-node/.devcontainer/base.Dockerfile
# [Choice] Node.js version: 14, 12, 10
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"

View File

@ -0,0 +1,29 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/javascript-node
{
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 10, 12, 14
"args": { "VARIANT": "14" }
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}

218
.gitignore vendored
View File

@ -1,33 +1,37 @@
# Windows image file caches
Thumbs.db
ehthumbs.db
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
# Folder config file
Desktop.ini
# Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,executable,grunt,macos,node,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,visualstudiocode,executable,grunt,macos,node,vscode
# Recycle Bin used on file shares
$RECYCLE.BIN/
### Executable ###
*.app
*.bat
*.cgi
*.com
*.exe
*.gadget
*.jar
*.pif
*.vb
*.wsf
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
### grunt ###
# Grunt usually compiles files inside this directory
dist/
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
# OSX
# =========================
# Grunt usually preprocesses files such as coffeescript, compass... inside the .tmp directory
.tmp/
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
@ -38,6 +42,7 @@ $RECYCLE.BIN/
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
@ -45,3 +50,174 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env*.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Storybook build outputs
.out
.storybook-out
storybook-static
# rollup.js default build output
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# Temporary folders
tmp/
temp/
### VisualStudioCode ###
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
*.code-workspace
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### vscode ###
!.vscode/settings.json
!.vscode/extensions.json
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,executable,grunt,macos,node,vscode
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
build

52
Gruntfile.js 100644
View File

@ -0,0 +1,52 @@
module.exports = function(grunt){
const sass = require('node-sass');
// require('load-grunt-tasks')(grunt);
// Configuration
grunt.initConfig({
// pass in options to plugin, references to file, etc.
concat: {
js: {
src: ['js/*.js'],
dest: 'build/scripts.js'
},
css: {
src: ['css/reset.css', 'css/bootstrap.css', 'css/styles.css'],
dest: 'build/styles.js'
}
},
sass: {
options: {
implementation: sass,
sourceMap: true
},
dist: {
files: {
'css/sass/styles.scss': 'css/styles.css'
}
}
},
uglify: {
build: {
files: [{
src: 'build/scripts.js',
dest: 'build/scripts.js'
}]
}
}
});
// Load plugins
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Register tasks
grunt.registerTask('concat-js', ['concat:js']);
grunt.registerTask('concat-css', ['concat:css']);
}

3
README.md 100644
View File

@ -0,0 +1,3 @@
# README
This pratice repo is built following Youtube Tutorial series [Grunt JS Tutorial](https://www.youtube.com/watch?v=KAD-l__vek4&list=PL4cUxeGkcC9j85fkVyCzCMJDfteLtrl_y)

View File

@ -2,6 +2,8 @@ $base-color: #777;
$second-color: #333;
$heading-font: Arial;
@import 'mixins';
.element {
width: 100px;
height: 100px;
@ -18,4 +20,5 @@ $heading-font: Arial;
.heading{
font-family: $heading-font;
@include ninjalink ('blue', 'red', 'pink', 'purple')
}

3447
package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

23
package.json 100644
View File

@ -0,0 +1,23 @@
{
"name": "grunt-playlist",
"version": "1.0.0",
"description": "This pratice repo is built following Youtube Tutorial series [Grunt JS Tutorial](https://www.youtube.com/watch?v=KAD-l__vek4&list=PL4cUxeGkcC9j85fkVyCzCMJDfteLtrl_y)",
"main": "app.js",
"dependencies": {},
"devDependencies": {
"grunt": "^1.3.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-uglify": "^5.0.0",
"grunt-sass": "^3.1.0",
"node-sass": "^5.0.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "ssh://git@lj918plus.dsmynas.com:2223/Jason/grunt-playlist.git"
},
"author": "",
"license": "ISC"
}