Closed ghost closed 7 years ago
Try this:
closure { warningLevel = 'QUIET' compilerOptions.languageIn="ECMASCRIPT6" compilerOptions.languageOut="ECMASCRIPT5" compilerOptions.processCommonJSModules = true compilerOptions.moduleRoots = ['src/main/webapp/client/static/js/'] compilationLevel = "ADVANCED_OPTIMIZATIONS" }
I'm using version 2.14.1 and that seems to work. Overwrites the property as defined in: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/CompilerOptions.java
thanks @florian-besser but i can't resolve the problem...
I'm using the com.eriwen.gradle.js.tasks.MinifyJsTask
in this task too.
source = [
"src/main/webapp/client/static/js/app/angular/v1.5.5/angular.min.js",
"src/main/webapp/client/static/js/app/angular/v1.5.5/angular-animate.min.js",
"src/main/webapp/client/static/js/app/angular/v1.5.5/angular-aria.min.js",
"src/main/webapp/client/static/js/app/angular/v1.5.5/angular-messages.min.js",
"src/main/webapp/client/static/js/app/angular/v1.5.5/angular-filter.min.js",
"src/main/webapp/client/static/js/app/angular-material/v1.1.0/angular-material.min.js",
"src/main/webapp/client/static/js/app/atsclient/app.client.js"
]
dest = file("src/main/webapp/client/dist/js/angular.min.js")
closure {
warningLevel = 'QUIET'
//compilationLevel = 'WHITESPACE_ONLY'
compilerOptions.languageIn="ECMASCRIPT6"
compilerOptions.languageOut="ECMASCRIPT5"
compilerOptions.angularPass=true
compilerOptions.processCommonJSModules=true
compilerOptions.moduleRoots=['src/main/webapp/client/static/js/app/atsclient/']
compilationLevel = "ADVANCED_OPTIMIZATIONS"
}
import { configuration } from 'config'
When i try to import file using this example in app.client.js
and config.js
are in the same directory that app.client.s
(moduleRoots
), i've this error my/largepath... ERROR - Failed to load module "./config" import { configuration } from './config';
The config file is, i think that i'm exporting the config:
'use strict';
let configuration = { ... }
export configuration;
@dankkomcg have you succeeded to import a file?
@dankkomcg I have the same problem. Do you have a solution for it? thanks
I use the google closure compiler... reading documentation, the error can't be solved with:
--js_module_root
but i don't know when i can use this flag on gradle.My closure config:
Any idea?