mirror of
https://github.com/marko-js/marko.git
synced 2026-01-25 15:03:04 +00:00
Merge pull request #716 from marko-js/issue-688
fixes #688 - add reference to browser.json in meta dependencies
This commit is contained in:
commit
b9f6624093
@ -17,13 +17,15 @@ function getComponentFiles(filename) {
|
||||
var styleMatch = new RegExp('^'+fileMatch+'style\\.\\w+$');
|
||||
var componentMatch = new RegExp('^'+fileMatch+'component\\.\\w+$');
|
||||
var splitComponentMatch = new RegExp('^'+fileMatch+'component-browser\\.\\w+$');
|
||||
var packageMatch = new RegExp('^'+fileMatch+'browser\\.\\json$');
|
||||
|
||||
var dirname = path.dirname(filename);
|
||||
|
||||
var foundFiles = {
|
||||
styles: [],
|
||||
file: null,
|
||||
browserFile: null
|
||||
browserFile: null,
|
||||
package: null
|
||||
};
|
||||
|
||||
var dirFiles = fs.readdirSync(dirname);
|
||||
@ -38,6 +40,8 @@ function getComponentFiles(filename) {
|
||||
foundFiles.browserFile = file;
|
||||
} else if (componentMatch.test(file)) {
|
||||
foundFiles.file = file;
|
||||
} else if (packageMatch.test(file)) {
|
||||
foundFiles.package = file;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -160,6 +160,10 @@ module.exports = function handleRootNodes() {
|
||||
context.addDependency('./' + styleFile);
|
||||
});
|
||||
|
||||
if (componentFiles.package) {
|
||||
context.addDependency('package: ./' + componentFiles.package);
|
||||
}
|
||||
|
||||
if (componentFiles.file) {
|
||||
let file = componentFiles.file;
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var marko_template = module.exports = require("marko/src/html").t(__filename);
|
||||
|
||||
function render(input, out) {
|
||||
var data = input;
|
||||
|
||||
out.w("YOLO");
|
||||
}
|
||||
|
||||
marko_template._ = render;
|
||||
|
||||
marko_template.meta = {
|
||||
deps: [
|
||||
"package: ./browser.json"
|
||||
]
|
||||
};
|
||||
@ -0,0 +1 @@
|
||||
-- YOLO
|
||||
Loading…
x
Reference in New Issue
Block a user