Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
leonekmi committed Mar 19, 2019
1 parent cd695b2 commit 79fb1b3
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 1,669 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "src/Semantic-UI-CSS"]
path = src/Semantic-UI-CSS
url = https://github.com/leonekmi/Semantic-UI-CSS.git
Empty file removed dist/.gitkeep
Empty file.
45 changes: 4 additions & 41 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,49 +23,20 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
buildTime: grunt.template.today('yyyy-mm-dd HH-MM-ss'),
browserify: {
dist: {
files: {
'build/bootstrap.bundle.js': 'src/bootstrap.js',
'build/website.bundle.js': 'src/website.js',
'build/pages/popup.bundle.js': 'src/pages/popup.js',
'build/pages/settings.bundle.js': 'src/pages/settings.js',
'build/auth/anilist.bundle.js': 'src/auth/anilist.js'
}
},
dev: {
files: {
'src/bootstrap.bundle.js': 'src/bootstrap.js',
'src/website.bundle.js': 'src/website.js',
'src/pages/popup.bundle.js': 'src/pages/popup.js',
'src/pages/settings.bundle.js': 'src/pages/settings.js',
'src/auth/anilist.bundle.js': 'src/auth/anilist.js'
}
}
},
webpack: {
oprions: {
stats: !process.env.NODE_ENV || process.env.NODE_ENV === 'development'
},
prod: Object.assign({ mode: 'production' }, webpackcfg),
dev: Object.assign({ watch: true, mode: 'development'}, webpackcfg)
},
copy: {
dist: {
files: [
{expand: true, cwd: 'src/', src: ['**'], dest: 'build/', filter: function(filepath) {
return !/bundle\.js/.test(filepath);
}}
]
}
},
compress: {
dist: {
options: {
archive: 'target/<%= pkg.name %> <%= pkg.version %> <%= buildTime %>.zip'
},
files: [
{expand: true, cwd: 'build/', src: ['**'], dest: './'}
{expand: true, cwd: 'dist/', src: ['**'], dest: './'}
]
}
},
Expand All @@ -85,12 +56,6 @@ module.exports = function(grunt) {
dest: 'target/'
}
},
watch: {
js: {
files: ['src/*.js', 'src/websites/*.js', 'src/libraries/*.js', 'src/pages/settings.js'],
tasks: ['browserify:dev']
}
},
webext_builder: {
dist: {
targets: ['firefox-xpi', 'chrome-crx'],
Expand All @@ -104,18 +69,16 @@ module.exports = function(grunt) {
}
});

grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-zip-to-crx');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-webext-builder');
grunt.loadNpmTasks('grunt-eslint');

// Default task(s).
grunt.registerTask('default', ['copy', 'browserify:dist', 'compress', 'zip_to_crx']);
grunt.registerTask('default', ['webpack:prod', 'compress', 'zip_to_crx']);
grunt.registerTask('lint', ['eslint']);
grunt.registerTask('build', ['copy', 'browserify:dist', 'compress', 'webext_builder']);
grunt.registerTask('build', ['webpack:prod', 'compress', 'webext_builder']);
grunt.registerTask('watch', ['webpack:dev']);

};

0 comments on commit 79fb1b3

Please sign in to comment.