TrilonIO / aspnetcore-Vue-starter

*NEW* Asp.net Core & Vue.js (ES6) SPA Starter kit - Vuex, webpack, Web API, Docker, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.22k stars 266 forks source link

Production build/Publish/webpack.config.vendor.js #31

Closed StormGoth closed 7 years ago

StormGoth commented 7 years ago

Hello,

when trying to publish this project I get the usual "Unexpected token: name (b) [vendor.js:20623,5]" from UglifyJS indicating that it wasn't translated to es2015.

So I copied the content of webpack.config.js to webpack.config.vendor.js (since it seemed to have the correct 'isDevBuild' flag and uses the babel preprocessor), but now the stuff from ClientApp isn't included when published: Exception: Call to Node module failed with error: Prerendering failed because of error: Error: ENOENT: no such file or directory, open 'C:\inetpub\wwwroot\...\ClientApp\boot-server.js'

After manually copying this directory (sorry, new to webpack/babel, no idea how to reference the bundled/ processed js files) I got the error:Cannot find module 'aspnet-prerendering' - seems logical since it is only included as a devDependency in package.json :)

Since I don't know what I'm doing I'll stop here :)

erw13n commented 7 years ago

I got same issue, solve it by remove "style-loader" from vendor entry.

MarkPieszak commented 7 years ago

Strange that this issue randomly sprung up, removing style-loader doesn't break any other functionality? If everything else works with that removed, that works for me 👍

Want to submit a quick lil PR for that fix @erw13n ? Thanks for figuring that one out!

erw13n commented 7 years ago

OK, sure.