Comments (5)
Could you please show more of your Gruntfile?
from postcss-banner.
Wow, thanks for getting back to me so quickly. Here is my full PostCSS Grunt task.
var autoprefixer = require('autoprefixer-core'),
cssURLs = require('postcss-url'),
cssBanner = require('postcss-banner');
postcss: {
build:{
options: {
map: false,
processors: [
cssBanner({
banner: ' \n' +
'Theme Name: Theme Name \n' +
'Version: <%= pkg.version %> \n' +
'Theme URI: http://mydomain.com\n' +
'Author: <%= pkg.author %> \n' +
'Author URI: https://mydomain.com\n' +
'Description: <%= pkg.description %> \n' +
'Text domain: <%= pkg.name %>\n'
})
]
},
src: 'style.css',
dest: 'style.css'
},
dev: {
options: {
map: false,
processors: [
cssURLs({
url :"rebase"
})
]
},
src: '<%= project.css %>dev.css',
dest: '<%= project.css %>dev.css'
},
dist: {
options: {
map: true,
processors: [
autoprefixer({
browsers: ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1']
}), // add vendor prefixes
cssURLs({
url :"rebase"
})
]
},
src: '<%= project.css %><%= project.app %>.min.css',
dest: '<%= project.dist %><%= project.app %>.min.css'
}
},
Let me know if you need more?
from postcss-banner.
grunt isn't able to replace variables in function arguments (like cssBanner).
Possible workaround is to use simple concatenation instead:
var pkg = require('./package.json');
...
pkg: pkg,
postcss: {
build:{
options: {
map: false,
processors: [
cssBanner({
banner: ' \n' +
'Theme Name: Theme Name \n' +
'Version: ' + pkg.version + '\n' +
...
from postcss-banner.
@princed thanks for your help, it worked and thanks for helping me better understand Grunt :)
from postcss-banner.
You're welcome :)
from postcss-banner.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-banner.