Skip to content
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

Add copy task runner #49

Merged
merged 3 commits into from Sep 12, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1,6 +1,2 @@
/dist
/node_modules

# Ignore everything in src folder except for loggly.tracker.js file
/src/*
!/src/loggly.tracker.js
@@ -3,6 +3,3 @@ Gruntfile.js
bower.json
.editorconfig
package-lock.json

# Allow everything under src directory
!/src/*
@@ -9,12 +9,48 @@ module.exports = function (grunt) {
},
main: {
files: [{
src: 'src/loggly.tracker.js',
dest: 'dist/loggly.tracker-' + packageJson.version + '.min.js'
}]
src: 'src/loggly.tracker.js',
dest: 'dist/loggly.tracker-' + packageJson.version + '.min.js'
}]
},
},
copy: {
main: {
files: [{
expand: true,
cwd: 'src',
src: 'loggly.tracker.js',
dest: 'dist/',
},{
expand: true,
src: 'src/loggly.tracker.js',
rename: function () {
return 'dist/loggly.tracker-latest.js';
}
},{
expand: true,
src: 'src/loggly.tracker.js',
rename: function () {
return 'dist/loggly.tracker-' + packageJson.version + '.js';
}
},{
expand: true,
src: 'dist/loggly.tracker-' + packageJson.version + '.min.map',
rename: function () {
return 'dist/loggly.tracker-latest.min.map';
}
},{
expand: true,
src: 'dist/loggly.tracker-' + packageJson.version + '.min.js',
rename: function () {
return 'dist/loggly.tracker-latest.min.js';
}
}
]
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['uglify', 'copy']);
};
@@ -96,5 +96,5 @@ Build min and map file
You can build min and map file by using the command below:
```
npm install
grunt uglify
grunt
```
@@ -18,6 +18,7 @@
"devDependencies": {
"bower": "^1.8.0",
"grunt": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^3.0.1"
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.