Skip to content

Instantly share code, notes, and snippets.

@maiha maiha/
Last active Dec 12, 2018

What would you like to do?

merge multiple private libraies into one js

  • webpack-3.12.0


  entry: {
    'main.bundle.js': './src/assets/javascripts/main.js'
  output: {
    filename: '[name]',
    path: path.resolve(__dirname, '../../public/dist'),
    publicPath: '/dist'

private lib 1

function foo() {
module.exports = foo;

private lib 2

function bar() {
module.exports = bar;


import foo from './lib1.js'
import bar from './lib2.js'

if (! { = foo; }
if (! { = bar; }


<script src="/dist/main.bundle.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.