1

I'm trying to make some simple project with AngularJs using ES6 with Traceur compiler and with Spring Boot as my backend. I already managed to configure my project so it works as I expected. I only have some problems with configuring IntelliJ to see my resources properly.

I put my static resources in src/main/resources/public and configure ResourceHandlerRegistry so that it redirects any unknown request to the main angular application file (I want to use html5 location mode, so it was necessary. I found working configuration in the second answer of this question Spring Boot with AngularJS html5Mode).

The error occurs when I import any of my ES6 modules:

import {appModule as app} from 'resources/app/main.js'; // <- here IntelliJ sees an error, it cannot find such file, but when I run the application it all works as expected

Here I uploaded my whole project: http://www.filedropper.com/spring-boot-test

Could anyone tell me what should I do to get rid of this error in IntelliJ or check what I've done wrong with my project?

btw. I use IntelliJ 14.

Edit: I had error in StaticResourceConfigurator. It should be:

/* ... */
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/resources/**").addResourceLocations("classpath:/public/");

Instead of:

/* ... */
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry
            .addResourceHandler("/public/**").addResourceLocations("classpath:/resources/");

But it didn't solve my problem.

Community
  • 1
  • 1
gandalfml
  • 908
  • 1
  • 10
  • 23

0 Answers0