Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit e341aec

Browse files
author
Ingwie Phoenix
committed
Loader in conjunction with ejs2. Test works as it should.
1 parent 3cabe73 commit e341aec

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
#ide
44
.idea
55
/*.iml
6+
test/bundle.js

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "ejs-compiled-loader",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "EJS webpack loader (without frontend dependencies)",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "cd test && ../node_modules/.bin/webpack && node bundle.js"
88
},
99
"repository": {
1010
"type": "git",
@@ -23,7 +23,11 @@
2323
},
2424
"homepage": "https://github.com/bazilio91/ejs-compiled-loader",
2525
"dependencies": {
26-
"ejs": "^1.0.0",
26+
"ejs": "^2.0.0",
2727
"uglify-js": "~1.3.4"
28+
},
29+
"devDependencies": {
30+
"node-libs-browser": "^0.5.0",
31+
"webpack": "^1.9.4"
2832
}
2933
}

test/app.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var tpl = require("./template.ejs");
2+
console.log(tpl({noun: "World"}));

test/template.ejs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello, <%=noun%>!

test/webpack.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
entry: "./app.js",
3+
output: {
4+
path: __dirname,
5+
filename: "bundle.js"
6+
},
7+
module: {
8+
loaders: [
9+
{ test: /\.ejs$/, loader: require.resolve("../") }
10+
]
11+
}
12+
}

0 commit comments

Comments
 (0)