I’ve installed a package using
npm install stuff --save wich is bringing its
.js and some
css into the project.
The project uses
In a template I’m doing:
import Stuff from 'stuffjs';
In development is all completely fine.
When I run in the dev machine with
meteor --settings=settings.json --production is also all completely fine.
But navigating to the deployed build brings says:
Uncaught Error: Cannot find module 'stuffjs/dist/stuff.css'
How I suppose to include in a way that works both in dev and the built app?
I’ve made a test, commenting out
import 'stuffjs/dist/stuff.css'; and adding the
.css content of that npm package into a style file and it works for dev.
In dev is all good, the issue remains on the server build.
changed the build command to:
meteor build . --architecture os.linux.x86_64
No differences in the output.
One thing I’ve noticed is this: When I do a build in the dev (OS X) machine, the .tar file has in
bundle/programs/server/npm/node_modules the following packages:
dotenv meteor meteor-node-stubs minimist mkdirp
But, when I go to check in the server build, expecting the very same list of packages, what I see is that only
meteor is present:
Something weird is going on with the build command to make this difference when run on OS X and other platforms? I cannot explain the source of that difference.
Update: there is nothing wrong with the imports. The issue is with the build.
I’m doing the
meteor build . --architecture os.linux.x86_64 manually in the dev machine as workaround (OS X). Something about the build pipeline is not doing what’s expected (I’m suspecting on node version at the moment)