Skip to content

Commit 5a203fb

Browse files
move relay example to apollo; update postcss
1 parent 941337a commit 5a203fb

File tree

6 files changed

+35
-36
lines changed

6 files changed

+35
-36
lines changed
File renamed without changes.

examples/relay/leo.config.js renamed to examples/apollo/leo.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
"scaffolding": "@sa-labs/leo-scaffolding-relay",
2+
"scaffolding": "@sa-labs/leo-scaffolding-apollo",
33
"plugins": [
44
"@sa-labs/leo-plugin-blogpost",
55
"@sa-labs/leo-plugin-markdown",

examples/relay/package.json renamed to examples/apollo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@sa-labs/leo-plugin-images": "file:../../packages/leo-plugin-images",
1717
"@sa-labs/leo-plugin-markdown": "file:../../packages/leo-plugin-markdown",
1818
"@sa-labs/leo-plugin-postcss": "file:../../packages/leo-plugin-postcss",
19-
"@sa-labs/leo-scaffolding-relay": "file:../../packages/leo-scaffolding-relay",
19+
"@sa-labs/leo-scaffolding-apollo": "file:../../packages/leo-scaffolding-apollo",
2020
"frontmatter-loader": "0.0.1"
2121
}
2222
}
File renamed without changes.

packages/leo-plugin-postcss/index.js

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,50 @@ var path = require('path');
33

44
module.exports = function configure(config) {
55

6-
config.loader('css', {
6+
// Project's CSS. Run CSS in modules mode with postcss
7+
config.module.rules.push({
78
test: /\.css$/,
8-
loader: ExtractTextPlugin.extract('style', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader')
9+
exclude: /node_modules/,
10+
loader: ExtractTextPlugin.extract({
11+
fallbackLoader: 'style-loader',
12+
loader: 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'
13+
})
914
});
1015

11-
1216
// Project's global css. Run PostCSS but not modules mode.
13-
config.loader('global-css', {
17+
config.module.rules.push({
1418
test: /\.global\.css$/,
15-
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader')
19+
loader: ExtractTextPlugin.extract({
20+
fallbackLoader: 'style-loader',
21+
loader: 'css-loader?importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'
22+
})
1623
});
1724

1825
// Third Party CSS. From node_modules. Don't process, just load.
19-
config.loader('third-party-css', {
26+
config.module.rules.push({
2027
test: /\.css$/,
2128
include: /node_modules/,
22-
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
29+
loader: ExtractTextPlugin.extract({
30+
fallbackLoader: 'style-loader',
31+
loader: 'css-loader'
32+
})
2333
});
2434

25-
config.plugin('extract-css',
26-
ExtractTextPlugin, ['styles.[contenthash].css', {
27-
allChunks: true
28-
}]);
29-
30-
config.merge({
31-
postcss: [
32-
require('postcss-brand-colors'),
33-
require('postcss-modular-scale'),
34-
require('postcss-responsive-type'),
35-
require('postcss-cssnext')({
36-
browsers: 'last 2 versions'
37-
}),
38-
require('lost')({
39-
flexbox: 'flex'
40-
}),
41-
require('postcss-font-magician')({
42-
hosted: path.resolve(process.cwd(), './fonts')
43-
}),
44-
// require('list-selectors').plugin(function(selectorList) {
45-
// console.log(selectorList)
46-
// }),
47-
require('immutable-css'),
48-
require('postcss-browser-reporter')
49-
]
35+
const extract = new ExtractTextPlugin({
36+
filename: 'styles.[contenthash].css',
37+
allChunks: true
5038
});
39+
if(config.plugins) {
40+
config.plugins.push(extract);
41+
} else {
42+
config.plugins = [extract];
43+
}
44+
45+
/* config.plugins.push(new webpack.LoaderOptionsPlugin({
46+
options: {
47+
context: __dirname
48+
}
49+
})); */
5150

5251
return config;
5352
}

packages/leo-plugin-postcss/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"css-loader": "^0.23.0",
22-
"extract-text-webpack-plugin": "^1.0.1",
22+
"extract-text-webpack-plugin": "^2.0.0-beta.4",
2323
"immutable-css": "^1.0.1",
2424
"list-selectors": "^2.0.0",
2525
"lost": "^7.1.0",
@@ -29,7 +29,7 @@
2929
"postcss-cssstats": "^1.0.0",
3030
"postcss-font-magician": "^1.4.0",
3131
"postcss-import": "^7.1.3",
32-
"postcss-loader": "^0.8.0",
32+
"postcss-loader": "^1.2.0",
3333
"postcss-modular-scale": "^2.5.1",
3434
"postcss-nested": "^1.0.0",
3535
"postcss-responsive-type": "^0.3.2",

0 commit comments

Comments
 (0)