-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
35 lines (31 loc) · 1001 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* PHPify - Compiles PHP modules to CommonJS with Uniter
* Copyright (c) Dan Phillimore (asmblah)
* /~https://github.com/uniter/phpify
*
* Released under the MIT license
* /~https://github.com/uniter/phpify/raw/master/MIT-LICENSE.txt
*/
'use strict';
/*
* Transform API: used by the Webpack loader, Babel plugin etc.
*/
var Transformer = require('./src/Transformer'),
TransformerFactory = require('./src/TransformerFactory'),
fs = require('fs'),
globby = require('globby'),
path = require('path'),
phpConfigLoader = require('phpconfig').createConfigLoader(fs.existsSync),
phpToAST = require('phptoast'),
phpToJS = require('phptojs'),
initialiserStubPath = path.resolve(__dirname + '/src/php/initialiser_stub.php'),
transformerFactory = new TransformerFactory(
Transformer,
phpConfigLoader,
phpToAST,
phpToJS,
require.resolve,
globby,
initialiserStubPath
);
module.exports = transformerFactory;