Skip to content

Commit

Permalink
Fix redfin#586: Support prefixes in babel module tags
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-wade committed Aug 23, 2016
1 parent d208b38 commit bb8720c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-plugin-react-server/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ module.exports = function() {
const {name} = node;

const trim = state.opts.trim;
const prefix = state.opts.prefix;
const parent = path.resolve(path.join(process.cwd(), '..')) + path.sep;
const filePath = this.file.opts.filename.replace(parent, '');

//TODO: Support labels
const moduleTag = loggerSpec({ filePath, trim });
const moduleTag = loggerSpec({ filePath, trim, prefix });

let tokens;
if (state.opts.tokens) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
["../../../src", { "prefix": "nicolas-lodeiro." }]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var logger = require('react-server').logging.getLogger(__LOGGER__);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var logger = require('react-server').logging.getLogger({"name":"nicolas-lodeiro.babel-plugin-react-server.test.fixtures.prefix.actual","color":{"server":207,"client":"rgb(212,42,212)"}});

0 comments on commit bb8720c

Please sign in to comment.