UNPKG

593 BJavaScriptView Raw
1import { resolve } from 'path';
2
3import {
4 CSS,
5 prepareCompilationEnvironment,
6 cleanupCompilationEnvironment,
7} from './utils/compile';
8
9// All further imports/requires will be transpiled
10// eslint-disable-next-line import/first
11import 'babel-register';
12
13function compileCSS(entryPointFilePath) {
14 prepareCompilationEnvironment();
15 const entryPointFileAbsolutePath = resolve(entryPointFilePath);
16 // eslint-disable-next-line global-require, import/no-dynamic-require
17 require(entryPointFileAbsolutePath);
18 cleanupCompilationEnvironment();
19 return CSS;
20}
21
22export default compileCSS;