charneykaye charneykaye - 4 months ago 56
Node.js Question

How do I configure IntelliJ for a full-stack JavaScript web app?

I'm building a web application using a MEAN stack: MongoDB, Express, Angular, and Node.js, based on Daftmonk's angular-fullstack Yeoman generator.

My preferred IDE is IntelliJ IDEA, partly because I also work on Ruby/Rails, Java, etc., and partly because it's f#%ing bad&@s and I love it.

What's the best way to configure it for this project?

Answer

Here's the best I've been able to do so far.

There are some crucial IntelliJ plugins to install:

  • .gitignore support
  • AngularJS
  • Base64 for IDEA and Storm
  • BashSupport
  • Bootstrap
  • CSS Support
  • Database Support
  • ddescriber for jasmine
  • Git Integration
  • GitHub
  • HAML
  • Heroku integration
  • HTML Tools
  • Jade
  • JavaScript Debugger
  • JavaScript Intention Power Pack
  • JavaScript Support
  • JS Toolbox
  • JUnit
  • Karma
  • LESS CSS Compiler
  • LESS support
  • Markdown
  • Mongo Plugin
  • NodeJS
  • Require.js plugin
  • REST Client
  • Spy-js
  • SvgViewer 2
  • Terminal
  • W3C Validators
  • YAML

As a peace offering to the mighty IntelliJ, use Java as project SDK:

use Java as project SDK, to keep IntelliJ happy

I prefer to configure four separate modules, to help separate back-end vs. front-end JavaScript dependencies:

I prefer to configure four separate modules, to help separate back-end vs. front-end JavaScript dependencies

Add the bower_components library to the client module, and the node_modules library to the server module:

Add the bower_components library to the client module, and the node_modules library to the server module

And be sure to enable JavaScript libraries in the editor.

Right click in editor and choose JavaScript libraries to use

Per best practices, we do not commit the local IntelliJ IDEA configuration folder (/.idea/) to the repository, instead adding it to the .gitignore file like so:

# IntelliJ IDEA local workspace
.idea

However, for some developers' convenience (and others' dismay) we might commit the four IntelliJ module .iml files to the repository:

client.iml
server.iml
e2e.iml
doc.iml

Happy coding!

Comments