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

Code Refactor #47

Merged
merged 12 commits into from Aug 16, 2017
@@ -0,0 +1,16 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
indent_style = space
indent_size = 2
@@ -0,0 +1,7 @@
/dist
/node_modules

# Ignore everything in src folder except for loggly.tracker.js file
/src/*
# !/src/loggly.tracker.js

@@ -1,3 +1,8 @@
jasminetest
Gruntfile.js
bower.json
bower.json
.editorconfig
package-lock.json

# Allow everything under src directory
!/src/*
@@ -1,19 +1,20 @@
module.exports = function (grunt) {
var packageJson = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
uglify : {
pkg: packageJson,
uglify: {
options: {
sourceMap : true
sourceMap: true,
sourceMapName: 'src/loggly.tracker-' + packageJson.version + '.min.map'
},
main : {
files : {
'src/loggly.tracker-2.1.min.js' : ['src/loggly.tracker.js']
}
main: {
files: [{
src: 'src/loggly.tracker.js',
dest: 'src/loggly.tracker-' + packageJson.version + '.min.js'
}]
}
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);

};
@@ -90,3 +90,10 @@ location /loggly/ {
proxy_pass http://logs-01.loggly.com;
}
```

Build min and map file
----------
You can build min and map file by using the command below:
```
grunt uglify
```
@@ -1,3 +1,3 @@
require('./src/loggly.tracker');
module.exports._LTracker = window._LTracker;
module.exports.LogglyTracker = window.LogglyTracker;
module.exports.LogglyTracker = window.LogglyTracker;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.