-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
44 lines (43 loc) · 1.46 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var path = require('path');
module.exports = function(grunt) {
grunt.initConfig({
// Move CSS and JS to _nuxt folder
// This enables the publicPath option to work
// so the Chrome Extension can load the app from website.
move: {
move_css: {
src: 'dist/*.css',
dest: 'dist/_nuxt/'
},
move_js: {
src: 'dist/*.js',
dest: 'dist/_nuxt/'
}
},
// Remove JS from chrome extension popup
dom_munger: {
remove_scripts: {
options: {
remove: 'script, link:first-of-type, link[rel="preload"]',
prefix: [
{selector:'img',attribute:'src', value:'https://www.challengegalaxy.com'}, {selector:'link',attribute:'href', value:'https://www.challengegalaxy.com'}
],
append: {selector:'body',html:'<script src="../popup.js"></script>'}
},
src: 'dist/chrome-extension/popup/index.html',
dest: 'dist/chrome-extension/popup/index.html'
},
},
// Zip the Chrome Extension for upload to the store.
zip: {
'using-cwd': {
cwd: 'dist/chrome-extension/',
src: ['dist/chrome-extension/*', 'dist/chrome-extension/popup/*', 'dist/chrome-extension/images/*'],
dest: 'dist/chrome_extension.zip'
}
}
});
grunt.loadNpmTasks('grunt-move');
grunt.loadNpmTasks('grunt-zip');
grunt.loadNpmTasks('grunt-dom-munger');
};