Here is my project folder structure:
project
|--Gruntfile.js
|--build
|--public
|--|--js
|-----|--lib
|-----|--module
|-----|--main.js
my build config is in the Gruntfile.js
requirejs: {
compileProject: {
baseUrl: 'js',
appDir: 'public',
dir: 'build',
modules: [
{ name: 'main'}
],
paths: {
main: 'main',
jquery: 'lib/jquery-1.10.0.min.js'
}
}
}
but when I run it, the terminal tell me wrong:
Running "requirejs:compileProject" (requirejs) task [Error: Error: Missing either an "out" or "dir" config value. If using "appDir" for a full project optimization, use "dir". If you want to optimize to one file, use "out".
however I have already set the dir value, so what's wrong with my code?
Your requirejs options should be specified within options:
requirejs: {
compileProject: {
options : {
baseUrl: 'js',
appDir: 'public',
dir: 'build',
modules: [
{ name: 'main'}
],
paths: {
main: 'main',
jquery: 'lib/jquery-1.10.0.min.js'
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With