var gulp = require('gulp'); var rimraf = require('gulp-rimraf'); var del = require('del'); // 清除開發時構建目錄 gulp.task('clean', function () { return del(['build']); }); // 清理髮布時構建目錄 gulp.task('clean-dist', function () { return del(['dist']); }); // 清理髮布時構建目錄(帶有aot預編譯) gulp.task('clean-aot', function () { return del(['dist', 'compiled']); }); // 編譯sass(release) gulp.task('sass-dist', function () { return gulp.src('src/themes/default/scss/default.scss') .pipe(sass().on('error', sass.logError)) .pipe(cleanCss()) .pipe(md5(20)) .pipe(rename({ suffix: '.min' })) .pipe(gulp.dest(config.build.themes + '/css')) }) gulp.task('watch-sass', function () { var watcher = gulp.watch('./src/themes/**/*.scss', ['sass-build']); watcher.on('change', function (event) { gutil.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); }) });
webpack代碼javascript
entry 入口
output 輸入路徑
loads 加載器
plugs 插件
又問 用過什麼!看你水平了。 固然是說你用的,下面是代碼,回憶一下!css
var webpack = require('webpack'); var webpackMerge = require('webpack-merge'); var commonConfig = require('./webpack.common'); var helpers = require('../helpers.js'); const ENV = process.env.ENV = process.env.NODE_ENV = 'development'; const HOST = process.env.HOST || 'localhost'; const PORT = process.env.PORT || 3000; const PUBLIC = process.env.PUBLIC || undefined; const HMR = helpers.hasProcessFlag('hot'); const METADATA = webpackMerge(commonConfig({ env: ENV }).metadata, { host: HOST, port: PORT, public: PUBLIC, ENV: ENV, HMR: HMR }); module.exports = function (env) { return webpackMerge(commonConfig({ env: ENV }), { devtool: 'cheap-module-eval-source-map', output: { path: helpers.root('build'), filename: 'scripts/[name].bundle.js', chunkFilename: 'scripts/[id].chunk.js' }, devServer: { historyApiFallback: true, stats: 'minimal' }, node: { global: true, crypto: 'empty', process: true, module: false, clearImmediate: false, setImmediate: false } }) }; var helpers = require('../helpers'); var webpack = require('webpack'); var path = require('path'); module.exports = { devtool: 'inline-source-map', resolve: { extensions: ['.ts', '.js', '.json'] }, module: { rules: [ { test: /\.ts$/, loader: 'tslint-loader', exclude: [helpers.root('node_modules')] }, { test: /\.ts$/, loaders: [ 'ts-loader', 'angular2-router-loader', 'angular2-template-loader' ], }, { test: /\.html$/, loader: 'raw-loader' }, { test: /\.json$/, loader: 'json-loader' }, { test: /\.ts/, include: [helpers.root('src')], loader: 'sourcemap-istanbul-instrumenter-loader?force-sourcemap=true', exclude: [/\.spec\.ts/, /\.e2e\.ts/, /node_modules/], enforce: 'post' } ] }, stats: { colors: true, reasons: true }, watch: true, plugins: [ new webpack.LoaderOptionsPlugin({ debug: true }), new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.join(__dirname)) ] };
vue路由跳轉方式?html
<router-link to="/myRegister">註冊</router-link>
③經過js的編程的方式前端
jumpToLogin: function () { this.$router.push('/myLogin'); }
什麼是閉包vue
function wrapper(){ var a = 1 function inner(){ a+=1 } return inner } 這就是閉包
瞭解數據解構嗎?java
隊列(先進先出,請參考電影票是否是先買票的先走) 映射到數組就是 push() shift()
棧:後進先出,漢諾塔上面的盤子移走才能移動下面的盤子。映射到數組就是 push() pop()
樹(二叉樹/滿二叉樹/徹底二叉樹)node
堆(最大堆/最小堆)webpack
性能優化手段?git
作一個css動畫 從0到200px 速度線性github
div{width:100px;animation:move 5s linear; } @keyframes move{ 0%{width:100px;} 50%{width:150px;} 100%{width:200px;} }
倒計時60秒
vue路由守衛
const router=new VueRouter({ mode:'history', routes:[...] })
未完待續>>>>>
溫故而知新~