Closed aogaili closed 6 years ago
I'm with the same problem, I'm migrating to relative imports just to check it everything else is working.
I'm also using only .js extension, migrating the React files to .jsx to see if I can run with webpack setup.
Ah I've the same setup and I'm also using .js extensions instead of .jsx.
However we're using absolute imports everywhere so it'll be major refactoring, perhaps I can test it on a smaller project until you do your refactoring.
I'm doing the same, starting on a smaller project, but if we can make it work, it'll be a major win for Meteor community :wink:
Thank you for all your support :) I think same with you. Meteor community needs this kind of packages to keep Meteor alive and growing. After that, I will try to reproduce your problem. Also I am now working on creating test environment with Webpack and make this package support test tools like Karma etc.
Thanks @ardatan!
I'm curious though, how is this package different from the existing older one on atmosphere?
I created this package from scratch without using this old one. New package uses the regular configuration structure and using the dependencies in your project’s node_modules instead of using the ones installed with ‘Npm.depends’. So the package doesn’t include ‘webpack’ and other dependencies . You can also add any webpack plugins by installing them via npm and add them to your ‘webpack.config’ llike the same way with ‘Webpack CLI’. In the old package, you have to install ‘webpack:typescript’ for TS support etc. You don’t need this in new package, just install your favorite ts plugin and add it to config file.
You can use webpack.config.js
resolve configuration settings to use similar path in your imports.
I am closing this issue. If you experience any problems, please open a new issue.
Thanks!
Hi @ardatan, I am experiencing the same problème and I cannot seem to find the accepted solution to this problem. Can You tell me how to fix this problem ?
Hello @aliogaili and @jlmbaka, I'm able to use like this:
import AdminPage from 'imports/ui/containers/shared/admin-page';
with this setup on webpack
resolve: {
extensions: ['*', '.js', '.jsx'],
alias: {
imports: path.resolve(__dirname, 'imports/'),
},
},
I believe in your case you just need to find/replace all imports in your source code from /imports/
to imports/
(removing the first slash)
Thanks for the interesting package!
I'm running into the following error:
The ./server/main.js has the following line:
import '/imports/startup/server';
Any idea what might be causing this? I think it might be due to the absolute paths since in the examples we've relative paths.