webpack: copy a filed without changing it's content -


i deploying project surge.sh

surge.sh needs 200.html file enable routing (sub-)pages of single page apps

my file looks this:

<!doctype html> <html>   <head>     <link rel="stylesheet" href="gs.1.0.0.css">   </head>   <body>     <script src="gs.1.0.0.js"></script>   </body> </html> 

when load using

import twohundredpage 'copy!./200.html' 

or

import twohundredpage 'file?name=200.html!./200.html' 

the resulting file looks this:

module.exports = __webpack_public_path__ + "9802140cc82d486c4b933fc3da03da99.html" 

and not work on surge.sh cdn

how can load file without changing it's contents? or in other words: just copy it?

edit (2015.06.01)

i have found no solution question.

but managed solve issue this:

by not hosting on surge instead on virtual server hapi.js didn't need copy 200.html file more (and configure hapi.js let index.html i.e. script handle 404's). thing anyway because virtual server digitalocean.com has responce time of 20ms (in case) opposed 300ms @ surge.sh!

by using react-favicon (my project uses react) reference favicon.ico in code > no need favicon in file named favicon in root of project more.

when import file via file-loader, copied on output folder – default, output.path in config. can configure output path , output filename in loader options. import returns url of file output.publicpath + filename.

if need retrieve raw contents of file, can use raw-loader.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -