New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set 'main' in 'package.json' to make webpack friendly #21

Closed
saitonakamura opened this Issue Aug 29, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@saitonakamura

saitonakamura commented Aug 29, 2016

When I'm trying to import semantic ui like this import semantic from 'sematic-ui-css' and build it with webpack it gives me Module not found: Error: Cannot resolve module 'semantic-ui-css'

Webpack is trying to find main field in package.json to find entrypoint or index.something if there isn't package.json or main field http://webpack.github.io/docs/resolving.html

If I manually add "main": "semantic.min.js", to node_modules/semantic-ui-css/package.json it builds fine, so I suggest adding this to package.json in npm

For now I'm using resolve.alias in my webpack.config.js

var path = require("path");

module.exports = {
     ...
     resolve: {
       alias: {
         'semantic-ui': path.join(__dirname, "node_modules", "semantic-ui-css", "semantic.min.js"),
       },
       ...
     },
     ...
 };

jlukic added a commit that referenced this issue Sep 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment