Comments (5)
I would also like to add, it would be nice to either be able to specify a custom config, or parse through a JSON array in the .pleeeaserc. Something like this:
{
"in": ["style.css"],
"out": "pleeease/style.css",
"browsers": ["last 3 versions", "Android 2.3"]
},
{
"in": ["media.css"],
"out": "pleeease/media.css",
"browsers": ["last 3 versions", "Android 2.3"]
}
from pleeease.
So I was actually able to implement a solution by parsing the config file in please-compile, then just reiterating over the multiple stylesheets in a single .pleeeaserc file. Basically I made a json array in the config file, and when we run the compile command, it does a for loop on each of the options, and then it runs
var cli = new CLI(inputs, output).compile();
I first check to see if the config file HAS a length more than 1, if it doesn't it just uses the command above with no for loop. Would be nice to see something that implements a feature like this.
Here is my final code for pleeease-compile file located in Roaming\npm\node_modules\pleeease-cli\bin:
#!/usr/bin/env node
var fs = require('fs');
var extend = require('deep-extend');
//var util = require('util');
var CLI = require('../lib/cli');
var program = require('commander');
program.
option('-t, to [file]', 'save compiled files to [file] (default: "app.min.css")').
parse(process.argv);
var inputs = program.args;
var output = program.to;
var extendConfig = function (opts) {
opts = opts || {};
// read pleeeaserc
var config = {};
try {
var configFile = '.pleeeaserc';
config = JSON.parse(fs.readFileSync(configFile, 'utf-8'));
} finally {
return extend(opts, config);
}
};
var opts = extendConfig();
var styleCount = Object.keys(opts).length;
if( styleCount > 1 ){
for(var e = 0; e < styleCount; e++){
inputs = opts[e].in;
output = opts[e].out;
var cli = new CLI(inputs, output).compile();
}
}else{
var cli = new CLI(inputs, output).compile();
}
from pleeease.
Added a pull request for pleeease-cli. It may not be smart code, but I am sure we can figure it out. We're implementing the solution I came up with yesterday, so it would be nice to somehow integrate it in. I didn't change it up to where the whole process would change, just made an array .pleeeaserc.
https://github.com/aolin480/pleeease-cli
from pleeease.
Any chance of having multiple files in OUT: anytime soon? This would be a very useful feature.
from pleeease.
Any news on this?
from pleeease.
Related Issues (20)
- PostCSS Plugin HOT 1
- Can I watch for multiple files and compile them respectively to multiple output files? HOT 1
- How do you stop a pleeease watch? HOT 1
- Getting lots of errors when trying to install pleeease HOT 3
- Crash while trying to compile on node v6.2.2 HOT 1
- Transform doesn't show all properties HOT 1
- Nested .class++ isn't minified right HOT 2
- Changes background url property. HOT 6
- Repeatedly Crashing on Node 7.7.3 HOT 7
- pleeease-watch on windows compile always (even if i do nothing) HOT 4
- Mark license to the package.json
- Package has vulnerable dependencies HOT 1
- Add fallback font
- compiling issues with comments
- error on gulp
- Compilation fails with sass indented syntax HOT 2
- Pleeease watch is watching all .css and .scss files for changes
- Vulnerable dependencies after Pleeease install
- Invalid SSL certificate https://pleeease.io 🔓
- (node:3208) UnhandledPromiseRejectionWarning
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 pleeease.