-
Notifications
You must be signed in to change notification settings - Fork 565
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
Webpacking npm module and using its files #43
Comments
you should be able to just For the css, right way is still being decided.. If you are using current master, you should be able to include in main.scss, but you'll need to resolve the path relative to node_modules. For example
otherwise you can add part/all of that path to the includePaths in webpack config, e.g.:
will allow you to just This will slightly change after #35, but it's probably worth thinking about how we want to handle external style deps. @choonkending thoughts? |
@psimyn Good analysis. I think having your first |
I'm not using the current master probably the version before react-hot-loader was added. Well in this case if I wanted to use AlloyEditor,it would be import * from 'alloy-editor' (ES6) in the component I'm using it at right? Also can you explain the alias for the for the resolve part of the webpack.config file a bit more. Thanks btw I really appreciate it. |
@kkotwal94 Yes you can import it that way. As for the resolve: {
extensions: ['', '.react.js', '.js', '.jsx', '.scss'],
modulesDirectories: [
"app", "node_modules"
]
}, This tells webpack to search through those directories (besides the current directory) when it encounters a file/module with those extensions. The resident webpack expert here is @psimyn, was that correct? Gimme a 👍 |
After looking at the documentation and trying this, hitting npm runscript start or watch, both tell me that it still can't resolve the module. |
If your alias is alloyeditor, did you import alloyeditor or alloy-editor. Otherwise check the path for alloyeditor, whether it really is the correct On Tue, 28 Jul 2015 01:57 kkotwal94 notifications@github.com wrote:
|
As for importing it, i tried 3 ways.
My file structure is here : https://github.com/kkotwal94/IsoReportProcessor as for the error it is
when importing * as alloy from alloyeditor and
when hitting npm start (running server.js) however webpack does not spit and issues if I change it during it is watching. I also tried finding the path from the directory, and it still gives me the same issue. |
@kkotwal94 No luck on my end. Not sure about how Then I could // Browser
entry: {
app: "./app",
test: "./components/Test"
}, I required that |
gotchya, well I guess i'll be back with a solution. Perhaps maybe you know any wysiwyg that works with requirejs/commonjs/amd loaders? Alloy-editor was the nicest/cleanest one I knew and it looks like they are working on it. They didn't write alloy-editor to be used in global environments like this from what I figured out. EDIT: liferay/alloy-editor#304 |
@kkotwal94 Good work!! |
@kkotwal94 Will close unless you have more questions :) |
I'm a little confused on how webpack is grabbing npm modules and including them.
For example:
i Know this includes our node_modules path, but what if im using a library, and I want to link its css and js files to my basehtml, then I would go to helmconfig.js right? Then add the link href to the links. But would it be something like this?
and the js file would I just include it <script></script> tags in the basehtml? Or is everything in the npm modules already applied?
I should just require("") it right?
The text was updated successfully, but these errors were encountered: