webpack-merge-and-include-globally icon indicating copy to clipboard operation
webpack-merge-and-include-globally copied to clipboard

Not works at development mode

Open jrichardsz opened this issue 5 years ago • 1 comments

Following the minimal example:

new MergeIntoSingleFilePlugin({
    files: {
        "vendor.js": [
            'src/assets/vendors/js/vendor.bundle.base.js'
        ]
    }
}),
<script src="./vendor.js"></script> 

I get this error when I execute npm run dev

  Error: Child compilation failed:
  Module not found: Error: Can't resolve './vendor.js' in '/home/jarvis/Incubator/webpack-starter/src':
  Error: Can't resolve './vendor.js' in '/home/jarvis/Incubator/webpack-starter/src'

But if I execute npm run build, I can see a new vendor.js file in dist folder and everything works fine!

What can I do to have the ./vendor.js at development stage?

Thanks

jrichardsz avatar Sep 21 '20 02:09 jrichardsz

@jrichardsz do you by chance call require('./vendor.js') somewhere in our code? if not then what is your entry in webpack config?

markshapiro avatar Sep 26 '20 20:09 markshapiro