PatrickJS-starter icon indicating copy to clipboard operation
PatrickJS-starter copied to clipboard

template vs templateUrl

Open kargenc opened this issue 10 years ago • 4 comments

i am using templateUrl, and stylesUrl in my component with same direcroty with component, but build script cant copy this html and css file to dist

how can i do copy this html css for components with WD

kargenc avatar Feb 28 '16 12:02 kargenc

Webpack isn't normally used for file moving/copying but you can make it do so by using the CopyWebpackPlugin. They are actually already using it for the /assets folder. Look in the webpack.config.js down around line 72 in the plugins section. Maybe you can copy that line and adjust it for your needs. But I'd say you are going off the seed's prescribed path. Why not just do the templates and styles the way the seed does them? Why add arbitrary http requests when that is completely unneeded?

timkindberg avatar Mar 01 '16 13:03 timkindberg

Does this project not support templateURL in production mode?

DocBradfordSoftware avatar Mar 08 '16 19:03 DocBradfordSoftware

using template: and require() is preferred since in production you would want to do that anyways

PatrickJS avatar Mar 09 '16 01:03 PatrickJS

there is no benefit using templateUrl since you can't use relative urls which is something that is supported by require

PatrickJS avatar Mar 13 '16 04:03 PatrickJS