Skip to content

Commit

Permalink
Add a dist npm script that compiles src/ to lib/
Browse files Browse the repository at this point in the history
  • Loading branch information
gnandretta committed Jan 6, 2016
1 parent 5d09fa0 commit ca6c97b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
build
lib/
node_modules/
release/
npm-debug.log
Expand Down
18 changes: 17 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ module.exports = function(grunt) {
]
}
},
babel: {
dist: {
files: [
{
expand: true,
cwd: "src",
src: ["**/*.js", "**/*.jsx"],
dest: "lib",
ext: '.js'
}
]
}
},
browserify: {
options: {
browserifyOptions: {
Expand Down Expand Up @@ -84,7 +97,8 @@ module.exports = function(grunt) {
},
clean: {
build: ["build/", "release/"],
dev: ["build/"]
dev: ["build/"],
dist: ["lib/"]
},
connect: {
dev: {
Expand Down Expand Up @@ -146,6 +160,7 @@ module.exports = function(grunt) {
});

grunt.loadNpmTasks("grunt-aws-s3");
grunt.loadNpmTasks("grunt-babel");
grunt.loadNpmTasks("grunt-browserify");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-connect");
Expand All @@ -158,6 +173,7 @@ module.exports = function(grunt) {


grunt.registerTask("build", ["clean:build", "env:build", "browserify:build", "uglify:build"]);
grunt.registerTask("dist", ["clean:dist", "babel:dist"]);
grunt.registerTask("dev", ["clean:dev", "connect:dev", "browserify:dev", "watch"]);
grunt.registerTask("design", ["clean:dev", "connect:dev", "browserify:design", "watch"]);
grunt.registerTask("purge_cdn", ["http:purge_js", "http:purge_js_min", "http:purge_major_js", "http:purge_major_js_min", "http:purge_minor_js", "http:purge_minor_js_min"]);
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"start": "grunt dev",
"build": "grunt build",
"design": "grunt design",
"dist": "grunt dist",
"test": "zuul -- test/*/*.test.js",
"test:browser": "zuul --local 8080 --disable-tunnel -- test/*/*.test.js",
"test:phantom": "mochify --recursive --extension=.jsx"
Expand All @@ -38,6 +39,7 @@
"expect.js": "^0.3.1",
"grunt": "^0.4.5",
"grunt-aws-s3": "^0.14.0",
"grunt-babel": "^6.0.0",
"grunt-browserify": "^4.0.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
Expand Down

0 comments on commit ca6c97b

Please sign in to comment.