Skip to content

Commit 88bd1a4

Browse files
committed
PostcssImport absolute paths
1 parent 40b4ecf commit 88bd1a4

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

packages/react-scripts/config/webpack.config.dev.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
var path = require('path');
1313
var cssnext = require('postcss-cssnext');
14+
var postcssImport = require("postcss-import");
1415
var webpack = require('webpack');
1516
var HtmlWebpackPlugin = require('html-webpack-plugin');
1617
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
@@ -173,6 +174,11 @@ module.exports = {
173174
// We use PostCSS for cssnext
174175
postcss: function() {
175176
return [
177+
postcssImport({
178+
root: path.join(__dirname, "./src"),
179+
path: path.join(__dirname, "./src"),
180+
addDependencyTo: webpack,
181+
}),
176182
cssnext({
177183
browsers: [
178184
'>1%',

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
var path = require('path');
1313
var cssnext = require('postcss-cssnext');
14+
var postcssImport = require('postcss-import');
1415
var webpack = require('webpack');
1516
var HtmlWebpackPlugin = require('html-webpack-plugin');
1617
var ExtractTextPlugin = require('extract-text-webpack-plugin');
@@ -192,6 +193,7 @@ module.exports = {
192193
// We use PostCSS for autoprefixing only.
193194
postcss: function() {
194195
return [
196+
postcssImport(),
195197
cssnext({
196198
browsers: [
197199
'>1%',

packages/react-scripts/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"object-assign": "4.1.0",
5555
"path-exists": "2.1.0",
5656
"postcss-cssnext": "2.8.0",
57+
"postcss-import": "8.2.0",
5758
"postcss-loader": "1.0.0",
5859
"promise": "7.1.1",
5960
"react-dev-utils": "^0.3.0",
@@ -107,6 +108,7 @@
107108
"object-assign",
108109
"path-exists",
109110
"postcss-cssnext",
111+
"postcss-import",
110112
"postcss-loader",
111113
"promise",
112114
"react-dev-utils",

0 commit comments

Comments
 (0)