Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
fix(cjs): export raw value (#183)
Browse files Browse the repository at this point in the history
* fix: exports raw value in cjs

* test: add `cjs` tests
  • Loading branch information
evilebottnawi authored and joshwiens committed Sep 30, 2017
1 parent 0c52ae2 commit daeff0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cjs.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
module.exports = require('./index').default;
const loader = require('./index');

module.exports = loader.default;
module.exports.raw = loader.raw;
12 changes: 12 additions & 0 deletions test/cjs.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import fileLoader from '../src';
import cjsFileLoader from '../src/cjs';

describe('cjs', () => {
it('should export loader', () => {
expect(cjsFileLoader).toEqual(fileLoader);
});

it('should export `raw` flag', () => {
expect(cjsFileLoader.raw).toEqual(true);
});
});

0 comments on commit daeff0e

Please sign in to comment.