Skip to content

Commit 3412e12

Browse files
committed
added banner to css output
1 parent ca537c4 commit 3412e12

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

Gruntfile.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const { sourceMapsEnabled } = require('process');
1212
module.exports = (grunt) => {
1313
require('@lodder/time-grunt')(grunt);
1414

15+
const pkg = grunt.file.readJSON('package.json');
16+
17+
const banner = `/* SCEditor v${pkg.version} | (C) 2017-${ new Date().getFullYear() }, Sam Clarke | sceditor.com/license */\n`;
18+
1519
grunt.event.on('qunit.coverage',
1620
function(data) {
1721
const outputDir = __dirname + '/coverage';
@@ -40,8 +44,6 @@ module.exports = (grunt) => {
4044
});
4145

4246
grunt.initConfig({
43-
pkg: grunt.file.readJSON('package.json'),
44-
4547
// Runs the unit tests
4648
qunit: {
4749
all: {
@@ -147,11 +149,10 @@ module.exports = (grunt) => {
147149
warnings: true,
148150
compress: true,
149151
mangle: true,
150-
banner: '/* SCEditor v<%= pkg.version %> | ' +
151-
'(C) 2017-<%= new Date().getFullYear() %>, Sam Clarke | sceditor.com/license */\n',
152-
sourceMap: {
153-
includeSources: true
154-
},
152+
banner: banner,
153+
sourceMap: {
154+
includeSources: true
155+
}
155156
},
156157
files: [
157158
{
@@ -194,7 +195,10 @@ module.exports = (grunt) => {
194195
options: {
195196
processors: [
196197
require('autoprefixer')(),
197-
require('cssnano')()
198+
require('cssnano')(),
199+
require('postcss-header')({
200+
header: banner
201+
})
198202
]
199203
},
200204
files: [

dist/sceditor.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"istanbul-reports": "^3.1.7",
6363
"jquery": "^3.7.1",
6464
"loader-utils": "^3.3.1",
65+
"postcss": "^8.5.6",
66+
"postcss-header": "^3.0.3",
6567
"qunit": "^2.24.1",
6668
"rangy": "^1.3.2",
6769
"sass": "^1.90.0",

0 commit comments

Comments
 (0)