Skip to content

Instantly share code, notes, and snippets.

View loveky's full-sized avatar
🍺
cheers

冰镇西瓜 loveky

🍺
cheers
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://echo.websocket.org/";
var output;
function init() {
@loveky
loveky / dd
Created September 24, 2017 10:04
dd
https://h5.m.jd.com/dev/3CMQyf7ZmW5DZ1zssth4Q6Vhnedr/index.html#none
@loveky
loveky / gist:3a2cbb393cbae5466da9bf1b018e8d81
Created May 5, 2018 06:10
extract all modules under node_modules referenced by entry chunks to a separate vender chunk
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all',
},
},
},
@loveky
loveky / webpack.config.js
Last active June 3, 2018 14:00
create HtmlWebpackPlugin in a loop
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpackConfig = {
mode: 'development',
devtool: 'cheap-module-source-map',
entry: {
index: process.cwd() + '/src/index'
},
output: {