Skip to content

Instantly share code, notes, and snippets.

View MrBr's full-sized avatar

Luka Bracanović MrBr

View GitHub Profile
@MrBr
MrBr / VendorInjectionPlugin.js
Created October 7, 2019 12:38
Webpack plugin for importing split library bundles within CRA environment.
const fs = require('fs');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// Used to replace vendor imports with empty string
const ConstDependency = require('webpack/lib/dependencies/ConstDependency');
function hashString(str) {
var hash = 0,
i,
chr;
@MrBr
MrBr / VendorInjectionPlugin.js
Created October 7, 2019 12:33
Webpack plugin used to import
const fs = require('fs');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// Used to replace vendor imports with empty string
const ConstDependency = require('webpack/lib/dependencies/ConstDependency');
function hashString(str) {
var hash = 0,
i,
chr;