@parcel/transformer-pug 2.8.4-nightly.0 → 2.9.0
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/lib/PugTransformer.js +0 -17
- package/package.json +4 -4
package/lib/PugTransformer.js
CHANGED
|
@@ -4,39 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _path() {
|
|
9
8
|
const data = _interopRequireDefault(require("path"));
|
|
10
|
-
|
|
11
9
|
_path = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _plugin() {
|
|
19
15
|
const data = require("@parcel/plugin");
|
|
20
|
-
|
|
21
16
|
_plugin = function () {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _pug() {
|
|
29
22
|
const data = _interopRequireDefault(require("pug"));
|
|
30
|
-
|
|
31
23
|
_pug = function () {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
|
-
|
|
40
29
|
var _default = new (_plugin().Transformer)({
|
|
41
30
|
async loadConfig({
|
|
42
31
|
config
|
|
@@ -44,14 +33,12 @@ var _default = new (_plugin().Transformer)({
|
|
|
44
33
|
let configFile = await config.getConfig(['.pugrc', '.pugrc.js', '.pugrc.cjs', '.pugrc.mjs', 'pug.config.js', 'pug.config.cjs', 'pug.config.mjs']);
|
|
45
34
|
return configFile === null || configFile === void 0 ? void 0 : configFile.contents;
|
|
46
35
|
},
|
|
47
|
-
|
|
48
36
|
async transform({
|
|
49
37
|
asset,
|
|
50
38
|
config
|
|
51
39
|
}) {
|
|
52
40
|
const pugConfig = config !== null && config !== void 0 ? config : {};
|
|
53
41
|
const content = await asset.getCode();
|
|
54
|
-
|
|
55
42
|
const render = _pug().default.compile(content, {
|
|
56
43
|
compileDebug: false,
|
|
57
44
|
basedir: _path().default.dirname(asset.filePath),
|
|
@@ -59,16 +46,12 @@ var _default = new (_plugin().Transformer)({
|
|
|
59
46
|
...pugConfig,
|
|
60
47
|
pretty: pugConfig.pretty || false
|
|
61
48
|
});
|
|
62
|
-
|
|
63
49
|
for (let filePath of render.dependencies) {
|
|
64
50
|
await asset.invalidateOnFileChange(filePath);
|
|
65
51
|
}
|
|
66
|
-
|
|
67
52
|
asset.type = 'html';
|
|
68
53
|
asset.setCode(render(pugConfig.locals));
|
|
69
54
|
return [asset];
|
|
70
55
|
}
|
|
71
|
-
|
|
72
56
|
});
|
|
73
|
-
|
|
74
57
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/transformer-pug",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"source": "src/PugTransformer.js",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">= 12.0.0",
|
|
20
|
-
"parcel": "2.
|
|
20
|
+
"parcel": "^2.9.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@parcel/plugin": "2.
|
|
23
|
+
"@parcel/plugin": "2.9.0",
|
|
24
24
|
"pug": "^3.0.2"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "dd9435be8afed35c5ffc161cf4b586fd6c78fc1f"
|
|
27
27
|
}
|