Skip to content

Instantly share code, notes, and snippets.

View huang-xiao-jian's full-sized avatar
🤓
On coding

黄小健 huang-xiao-jian

🤓
On coding
  • China
View GitHub Profile
if (
(!oldHtml || newHtml.__html != oldHtml.__html) &&
newHtml.__html !== dom.innerHTML
) {
dom.innerHTML = (newHtml && newHtml.__html) || "";
}
@huang-xiao-jian
huang-xiao-jian / settings.json
Created June 17, 2020 01:49
vscode exclude compile JS files
{
"**/*.js: "$(basename).ts"
}
@huang-xiao-jian
huang-xiao-jian / mini-vnode.json
Last active April 18, 2020 07:58
remax example
{
"type": "view",
"props": {
"classname": "app"
},
"children": [
{
"type": "view",
"props": {
"classname": "header"
@huang-xiao-jian
huang-xiao-jian / serve.config.js
Created September 25, 2018 03:32
webpack server configuration
/**
* @description - webpack server configurations
* @author - huang.jian <hjj491229492@hotmail.com>
*/
const convert = require('koa-connect');
const history = require('connect-history-api-fallback');
const proxy = require('http-proxy-middleware');
module.exports = {
@huang-xiao-jian
huang-xiao-jian / .babelrc
Last active August 18, 2019 08:25
babel shared configuration.
{
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"loose": true
}
],
"@babel/preset-react"
#!/usr/bin/env node
const path = require('path');
const fs = require('fs');
const fse = require('fs-extra');
const program = require('commander');
const glob = require('glob');
// internal
const welcome = require('../lib/welcome');
const { version } = require('../package.json');
@huang-xiao-jian
huang-xiao-jian / link.extension.js
Last active June 5, 2018 06:59
Handlebars 表达式扩展
@huang-xiao-jian
huang-xiao-jian / sw.js
Created June 1, 2018 13:31
配置 workbox PWA
/**
* @description - service worker strategy
* @author - huang.jian <hjj491229492@hotmail.com>
*/
/* eslint-env worker */
/* global workbox */
// import workbox library
importScripts(
@huang-xiao-jian
huang-xiao-jian / serve.config.js
Created June 1, 2018 07:01
webpack 开发服务器配置
/**
* @description - development configuration
* @author - yang.yuncai <383235388@qq.com>
*/
// dependency
const presets = require('@coco-platform/webpack-preset');
const convert = require('koa-connect');
const history = require('connect-history-api-fallback');
const proxy = require('http-proxy-middleware');
@huang-xiao-jian
huang-xiao-jian / require.context.js
Created June 1, 2018 07:00
webpack 多模块加载
const req = require.context('../src/stories', true, /\.story\.jsx?$/);
req.keys().forEach((filename) => req(filename));