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 5
5
"main" : " index.js" ,
6
6
"dependencies" : {
7
7
"css-modules-loader-core" : " 0.0.11" ,
8
+ "postcss" : " ^4.1.16" ,
8
9
"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"
10
12
},
11
13
"devDependencies" : {
12
14
"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