alwaysonlinetxm / rollup-plugin-fill-html

fill the html template with the bundle js..
MIT License
17 stars 14 forks source link

Wrong html output filename, sourcemap not hashed #3

Open osv opened 7 years ago

osv commented 7 years ago

I just checkout to this repo, go to examples, npm i, npm run start and I found next files:

bundle-7c3eb3d0c53e714ec52ed127228f3dca.js
html>?

Expected index.html. Actual: html>?

Also, in my project I got next files:

bundle-49e343424623b366c24fd9d0ed9cdcb5.js
bundle-[hash].js.map
html>

Expected: bundle-49e343424623b366c24fd9d0ed9cdcb5.map.js Actual: bundle-[hash].js.map

alwaysonlinetxm commented 7 years ago

@osv Thanks for your question! First, the html>? is resulted by my mistake of the config file. I forgot to pass param filename to plugin. I have fixed the config file, you can update the example code and have a try! Second, you are right, the name of the map file is a little weird, but not wrong. you can open the bundle file and look at the last line, and you will find this:

...
//# sourceMappingURL=bundle-[hash].js.map

As you see, the name of map file is just bundle-[hash].js.map. I know it's not a nice name, but I won't to do something about this recently, because I am a little busy, and actually it doesn't make any functional error.

osv commented 7 years ago

Make sense, thanks.

    html({
      template: 'src/index.html',
      filename: 'index.html'
    })

work for me. Yes. weird source map file name, it may be cached too, need to add hash too. Lets leave this issue openned, as reminder :)

alwaysonlinetxm commented 7 years ago

@osv ok!