mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Transition *.css to compiler plugins
Note that we will need to execute our plan to bump the isopack/unibuild formats and do careful backwards compatibility in order for published packages containing these css sources to still be usable by existing versions of Meteor. (This also will include bumping compiler.BUILT_BY.)
This commit is contained in:
@@ -2,9 +2,25 @@
|
||||
we can't exactly define the *.js source file handler in a *.js
|
||||
source file. */
|
||||
|
||||
Plugin.registerSourceHandler("css", {archMatching: 'web'}, function (compileStep) {
|
||||
compileStep.addStylesheet({
|
||||
data: compileStep.read().toString('utf8'),
|
||||
path: compileStep.inputPath
|
||||
});
|
||||
// NOTE: It's only OK for *this* package to call this function directly, because
|
||||
// otherwise we'd end up with a circular dependency between meteor and
|
||||
// compiler-plugin. The issue we're trying to avoid by requiring an explicit
|
||||
// dependency on compiler-plugin doesn't matter because css has some
|
||||
// backwards-compatibility special-casing in the tool.
|
||||
Plugin._doNotCallThisDirectly_registerCompiler({
|
||||
extensions: ['css'],
|
||||
archMatching: 'web'
|
||||
}, function () {
|
||||
return new CssCompiler;
|
||||
});
|
||||
|
||||
var CssCompiler = function () {
|
||||
};
|
||||
CssCompiler.prototype.processFilesForTarget = function (inputFiles) {
|
||||
inputFiles.forEach(function (inputFile) {
|
||||
inputFile.addStylesheet({
|
||||
data: inputFile.getContentsAsString(),
|
||||
path: inputFile.getPathInPackage()
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user