Skip to content

Commit 47dbdd1

Browse files
committed
init code
0 parents  commit 47dbdd1

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# tplite-loader
3+
4+
webpack loader for tplite template.
5+
6+
> using tplite.Template, compile to function when build project.
7+
8+

loader.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var { Template } = require('tplite');
2+
3+
var template = new Template();
4+
5+
module.exports = function(content) {
6+
var compile = template(content);
7+
return "module.exports = " + compile.toString().replace('anonymous', '') + ";\n";
8+
}

package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "tplite-loader",
3+
"version": "1.0.0",
4+
"description": "webpack loader for tplite template.",
5+
"main": "loader.js",
6+
"author": {
7+
"name": "lloydzhou",
8+
"email": "[email protected]"
9+
},
10+
"keywords": [
11+
"Webpack",
12+
"Loader",
13+
"tplite"
14+
],
15+
"repository": {
16+
"type": "git",
17+
"url": "https://github.com/tplite/loader"
18+
},
19+
"readmeFilename": "README"
20+
}

0 commit comments

Comments
 (0)