Skip to content

Commit 4688709

Browse files
committed
Use source variable in creator.create
1 parent f829c57 commit 4688709

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm-debug.log

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Simplest webpack loader for https://github.com/Quramy/typed-css-modules
44
Has no configuration atm.
55

6-
Use it as preloader. It will generate `.css.d.ts` files near the `.css`
6+
I suggest using it as preloader. It will generate `.css.d.ts` files near the `.css`
7+
Please take a look at [this discussion](https://github.com/Quramy/typed-css-modules/issues/2) to make a decision.
78

89
```js
910

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ var DtsCreator = require('typed-css-modules');
22

33
var creator = new DtsCreator();
44

5-
module.exports = function(input, map) {
5+
module.exports = function(source, map) {
66
this.cacheable && this.cacheable();
77
var callback = this.async();
8-
creator.create(this.resourcePath).then(content => {
8+
9+
// creator.create(..., source) tells the module to operate on the
10+
// source variable. Check API for more details.
11+
creator.create(this.resourcePath, source).then(content => {
912
content.writeFile().then(_ => {
10-
callback(null, input, map);
13+
callback(null, source, map);
1114
});
1215
});
1316
};
17+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typed-css-modules-loader",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Webpack loader for typed-css-modules",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)