-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGruntfile.js
More file actions
28 lines (24 loc) · 834 Bytes
/
Gruntfile.js
File metadata and controls
28 lines (24 loc) · 834 Bytes
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
/* eslint-disable @typescript-eslint/no-var-requires */
const webpackConfig = require('./webpack.config.js');
const { merge } = require('webpack-merge');
const webpackConfigProduction = merge(webpackConfig, {
devtool: false,
mode: 'production',
watch: false,
});
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
contents: ['frontend/static/frontend/css/*', 'frontend/static/frontend/js/*'],
},
webpack: {
prod: webpackConfigProduction,
dev: webpackConfig,
},
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-webpack');
grunt.task.registerTask('default', 'Run the default task', ['clean', 'webpack:dev']);
grunt.task.registerTask('build', 'Run production build', ['clean', 'webpack:prod']);
};