vue-meteor
vue-meteor copied to clipboard
<style> not minified for production when .vue are in folder "imports/..."
This is a continuation of the issue #156.
I am deploying using mup
, with nginx redirecting the only open port 80 to the docker container port 3000.
In the mup.js
settings, I set the NODE_ENV
variable accordingly, but the problem still exists.
env: {
ROOT_URL: 'https://edu.xxxxxx.taipei',
PORT: 3000,
MONGO_URL: 'mongodb://localhost/meteor',
NODE_ENV: 'production',
},
The CSS in the <style>
tags from the .vue
files is not showing on the deployed website, I have no clue of what I am supposed to do to make it work.
Hi @Akryum, I still have the problem with the CSS in the .vue
files not showing up on the client when the port 3003 is not open.
The CSS is also not loaded when I am launching my meteor app using meteor --production
. I believe that the problem has nothing to do with mup
(which I am not using at the moment), it may be a problem of vue-meteor
.
I tried this, and I could not find the CSS anywhere in the generated bundle:
meteor build ../output --server-only
.. and I finally found the source of the problem !
My .vue
components are located in /imports/ui/client/component
, they are not minified at all. If I make a .vue
component in /client/component
, it is minified during the build.
Is it a bug or a feature? (i.e. should I refactor my code to have the components somewhere in the /client/
folder or I should not refactor and wait for a fix in meteor-vue
instead?)
@green-coder Hey, I opened an issue on this yesterday, and didn't notice yours, have you resolved this? I'm getting the same problem during build for production, but I noticed it's only when I have the juliancwirko:postcss package running, if I change it back to standard-css-minifier, it all works fine.. Are you using that package also?
thx
@eybarta : I didn't solve it. Instead, I avoided the problem by moving all my components outside of the imports
directory. I would be happy to bring them back where they should be once this issue is fixed, if it happens one day.
I do use the juliancwirko:postcss
Meteor package.
@green-coder thx appreciate it.. I'll do the same for now.
Hello,
Did anyone find a solution to minify css/scss from vue components ??
When you are not using the imports
folder, all files are globally imported by Meteor. We prefer to use imports
(as a black box) to import files in the order we want
Exactly the same issue here. Anyone able to solve the problem?