Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
How to create a commons chunk file from two packages?

I have two private packages with their own package.json, dependencies etc.

I have installed both into a third package with the idea I could then use webpack to build them and a commons chunk file, however it doesn't appear to want to play ball.

npm install /my/local/package1
npm install /my/local/package2

(in reality, I'd use a private npm or git)

in webpack.config.json

module.exports = {
  entry: {
    'package1': 'package1',
    'package2': 'package2'
  }
  ...,
  plugins = [
    new webpack.optimize.CommonsChunkPlugin({
      name: "commons",
    }),
    ...

When it builds, I get both packages built fine but only a minimal commons file.

I'm testing it with two packages that are identical aside from name, so should have everything in common.

Is there a way to get this done?

Or other strategy to allow me to develop separate apps, that can then be exported together with a commons chunk..

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Think I have solved it by setting minChunks = 2 - is it 3 by default? no mention of defaults as far as I can see on the docs.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!