mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Changes to allow marko v3 compiler to work in the browser
This commit is contained in:
parent
864c168368
commit
186e5fca03
8
compiler/browser.json
Normal file
8
compiler/browser.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"../taglibs/async/browser.json",
|
||||
"../taglibs/core/browser.json",
|
||||
"../taglibs/html/browser.json",
|
||||
"../taglibs/layout/browser.json"
|
||||
]
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2011 eBay Software Foundation
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@ -22,5 +22,11 @@ function excludeDir(dirname) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
function clearCache() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
|
||||
exports.find = find;
|
||||
exports.excludeDir = excludeDir;
|
||||
exports.excludeDir = excludeDir;
|
||||
exports.clearCache = clearCache;
|
||||
5
taglibs/async/package.json
Normal file
5
taglibs/async/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"browser": {
|
||||
"./client-reorder.js": "./client-reorder-browser.js"
|
||||
}
|
||||
}
|
||||
5
taglibs/cache/browser.json
vendored
Normal file
5
taglibs/cache/browser.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"require: *.js"
|
||||
]
|
||||
}
|
||||
5
taglibs/core/browser.json
Normal file
5
taglibs/core/browser.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"require: *.js"
|
||||
]
|
||||
}
|
||||
17
taglibs/core/include-text-tag-browser.js
Normal file
17
taglibs/core/include-text-tag-browser.js
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
module.exports = function codeGenerator(el, codegen) {
|
||||
let argument = el.argument;
|
||||
if (!argument) {
|
||||
return;
|
||||
}
|
||||
|
||||
let builder = codegen.builder;
|
||||
let pathExpression = builder.parseExpression(argument);
|
||||
if (pathExpression.type !== 'Literal' || typeof pathExpression.value !== 'string') {
|
||||
codegen.addError('Argument to the <include-text> tag should be a string value: <include-text("./foo.txt")/>');
|
||||
return;
|
||||
}
|
||||
|
||||
var path = pathExpression.value;
|
||||
return builder.text(builder.literal('<include-text> cannot be compiled in the browser (path="' + path + '")'));
|
||||
};
|
||||
5
taglibs/core/package.json
Normal file
5
taglibs/core/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"browser": {
|
||||
"./include-text-tag.js": "./include-text-tag-browser.js"
|
||||
}
|
||||
}
|
||||
5
taglibs/html/browser.json
Normal file
5
taglibs/html/browser.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"require: *.js"
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user