Parcel: .cshtml (razor) Build Target

Created on 26 Jul 2018  ยท  3Comments  ยท  Source: parcel-bundler/parcel

โ” Question

Is it possible to use a razor view i.e. _Layout.cshtml as the build target? Right now it simply copies the file without building the JS/CSS etc. If I change the file to a .html extension the build happens as expected but the razor html helpers are removed.

๐Ÿ”ฆ Context

Trying to migrate from Gulp to Parcel in an Asp.net project. Right now we are in the proof of concept. Please let me know if you need more detail.

๐Ÿ’ป Code Sample

"scripts": {
"build": "parcel build /Views/Shared/_Layout.cshtml --public-url ./"
}

๐ŸŒ Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | [email protected]
| Node | v8.11.3
| npm/Yarn | 5.6.0 / 1.7
| Operating System | Windows 10

Question

All 3 comments

It's impossible to build cshtml with parcel.

You can however build all your js and css using parcel like this: parcel something.js somethingelse.css

Is it possible to build multiple js files? For example header.js, footer.js

Sorry, I didn't completely understand your answer at first. I just need to do parcel header.js footer.js

Thanks for your help sir!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

will-stone picture will-stone  ยท  3Comments

algebraic-brain picture algebraic-brain  ยท  3Comments

davidnagli picture davidnagli  ยท  3Comments

devongovett picture devongovett  ยท  3Comments

adamreisnz picture adamreisnz  ยท  3Comments