-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature/optimize #104
Feature/optimize #104
Changes from 24 commits
3c1c317
2d3c51c
d0b5841
af0efc6
78dc45a
eb91f45
fdcc6ca
2dceac6
fbe28a0
3a396b4
bf211b3
f25c8a7
e158d7a
e6eed0e
b2124a7
fdc2d48
bc3c376
ab3619f
1e13c70
31bbf0e
ff4b577
2e4be2a
02520b7
8553cce
7f8818c
1bac5b3
40252e8
aa2ea7d
4087373
231b433
1f58634
87505b2
3b88121
3f52322
c5945e3
0bd1724
4fcd47e
74042ca
9e1a3e4
cff21a4
e4c5ba9
6c86fe0
ecec9cb
e360111
d229775
7440c22
041249e
3df7e34
5257a8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"directory": "app/lib" | ||
"directory": "src/lib" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
node_modules/ | ||
config.js | ||
compiled/**/*.* | ||
app/lib/ | ||
src/lib/ | ||
dist/ | ||
example-widget/ | ||
build/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,27 @@ module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-contrib-connect'); | ||
grunt.loadNpmTasks('grunt-contrib-requirejs'); | ||
grunt.loadNpmTasks('grunt-bower-release'); | ||
grunt.loadNpmTasks('grunt-karma'); | ||
grunt.loadNpmTasks('grunt-shell'); | ||
grunt.initConfig({ | ||
bower: grunt.file.readJSON('bower.json'), | ||
|
||
clean: { | ||
all: { | ||
src: ["compiled", "dist"] | ||
src: ["build", "compiled", "dist"] | ||
} | ||
}, | ||
|
||
uglify: { | ||
sqwidget: { | ||
files: { | ||
'build/sqwidget-min.js': ['build/sqwidget.js'] | ||
} | ||
} | ||
}, | ||
|
||
connect: { | ||
publisher: { | ||
options: { | ||
|
@@ -24,24 +37,60 @@ module.exports = function(grunt) { | |
} | ||
} | ||
}, | ||
karma: { | ||
integration: { | ||
configFile: 'karma.conf.js' | ||
|
||
requirejs: { | ||
compile: { | ||
options: { | ||
baseUrl: "src", | ||
out: 'dist/<%= bower.name %>.js', | ||
paths: { | ||
almond: 'lib/almond/almond', | ||
requirejs: 'lib/requirejs/require', | ||
domReady: 'lib/requirejs-domready/domReady', | ||
}, | ||
include: ['requirejs', 'sqwidget'], | ||
// Wrapper for AMD | ||
wrap: { | ||
startFile: 'src/_wrapper/top.js', | ||
endFile: 'src/_wrapper/bottom.js' | ||
}, | ||
//optimize: 'uglify2', | ||
optimize: 'none', | ||
preserveLicenseComments: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular reason for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. smaller. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it makes using the libraries illegal with certain licenses. |
||
generateSourceMaps: true | ||
} | ||
} | ||
}, | ||
|
||
shell: { | ||
build_example: { | ||
command: "./build_example.sh" | ||
} | ||
}, | ||
|
||
watch: { | ||
scaffold: { | ||
files: ["grunt-scaffold/root/main.js", "grunt-scaffold/root/app/**/*.js", "grunt-scaffold/**/*.tmpl"], | ||
tasks: ["build"] | ||
} | ||
}, | ||
|
||
bowerRelease: { | ||
stable: { | ||
options: { | ||
endpoint: 'git://github.com/premasagar/sqwidget.git', | ||
stageDir: 'dist' | ||
}, | ||
files: { | ||
cwd: '.', | ||
src: ['sqwidget.js'], | ||
} | ||
} | ||
} | ||
|
||
}); | ||
grunt.registerTask("build", ["shell:build_example"]); | ||
grunt.registerTask("test", ["clean", "build", "karma"]); | ||
grunt.registerTask("build", ["requirejs:compile"]); | ||
grunt.registerTask("default", ["clean", "build", "connect", "watch"]); | ||
grunt.registerTask("dist", ["clean", "build"]); | ||
grunt.registerTask("release", ["dist", "bowerRelease:stable"]); | ||
}; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the
requirejs
compile needrequirejs
again?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because its bundled as part of the binary, so it can be namespaced and not need data-main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right! Could there be a comment there because it does look out-of-place and it's actually a feature?