@mtbdata711/twig-loader 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/compiler.js +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
# twig-loader
|
2
3
|
Webpack loader for compiling Twig.js templates. This loader will allow you to require Twig.js views to your code.
|
3
4
|
|
@@ -5,7 +6,7 @@ This is a fork of [@jfrk/twig-loader](https://github.com/jfrk/twig-loader) to su
|
|
5
6
|
|
6
7
|
## Installation
|
7
8
|
|
8
|
-
|
9
|
+
`npm i @mtbdata711/twig-loader`
|
9
10
|
|
10
11
|
## Usage
|
11
12
|
|
package/lib/compiler.js
CHANGED
@@ -18,10 +18,12 @@ module.exports = function(options) {
|
|
18
18
|
`${component}/${component}.twig`,
|
19
19
|
);
|
20
20
|
if (fs.existsSync(resolvedPath)) {
|
21
|
-
relativePath =
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
relativePath =
|
22
|
+
'./' +
|
23
|
+
path.relative(
|
24
|
+
path.dirname(resourcePath),
|
25
|
+
resolvedPath,
|
26
|
+
);
|
25
27
|
includes.push(relativePath);
|
26
28
|
token.value = hashGenerator(resolvedPath);
|
27
29
|
}
|