File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 55 "main" : " index.js" ,
66 "dependencies" : {
77 "css-modules-loader-core" : " 0.0.11" ,
8+ "postcss" : " ^4.1.16" ,
89 "postcss-modules-extract-imports" : " 0.0.5" ,
9- "postcss-modules-local-by-default" : " 0.0.11"
10+ "postcss-modules-local-by-default" : " 0.0.11" ,
11+ "postcss-modules-scope" : " 0.0.8"
1012 },
1113 "devDependencies" : {
1214 "babel" : " ^5.8.20" ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ if ( global . _cssModulesPolyfill ) {
4+ throw new Error ( 'only one instance of css-modules/polyfill is allowed' ) ;
5+ }
6+
7+ global . _cssModulesPolyfill = true ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ /**
4+ * @param {function } compile
5+ */
6+ module . exports = function ( compile ) {
7+ require . extensions [ '.css' ] = function ( m , filename ) {
8+ var tokens = compile ( filename ) ;
9+ return m . _compile ( 'module.exports = ' + JSON . stringify ( tokens ) , filename ) ;
10+ } ;
11+ } ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ import './guard' ;
4+ import fs from 'fs' ;
5+ import hook from './hook' ;
6+ import postcss from 'postcss' ;
7+
8+ import extractImports from 'postcss-modules-extract-imports' ;
9+ import localByDefault from 'postcss-modules-local-by-default' ;
10+ import scope from 'postcss-modules-scope' ;
11+
12+ let plugins = [ localByDefault , extractImports , scope ] ;
13+
14+ hook ( filename => postcss ( plugins ) . process ( fs . readFileSync ( filename , 'utf8' ) ) . css ) ;
15+
16+ /**
17+ * @param {object } opts
18+ * @param {array } opts.u
19+ * @param {array } opts.use
20+ */
21+ export default function configure ( opts ) { }
You can’t perform that action at this time.
0 commit comments