Skip to content

Commit

Permalink
BUGFIX: Fix the storybook integration and update to webpack 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkdpixels committed Nov 16, 2017
1 parent 4522229 commit f421380
Show file tree
Hide file tree
Showing 37 changed files with 672 additions and 375 deletions.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"babel-core": "^6.13.2",
"babel-eslint": "^7.1.1",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.20.1",
"babel-plugin-webpack-alias": "^2.1.1",
Expand All @@ -39,8 +39,8 @@
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.0",
"eslint": "^3.1.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.10.0",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.5",
"greenkeeper-postpublish": "^1.0.0",
"identity-obj-proxy": "^3.0.0",
"imports-loader": "^0.7.0",
Expand All @@ -52,22 +52,23 @@
"postcss-css-variables": "^0.7.0",
"postcss-hexrgba": "^0.2.0",
"postcss-import": "^10.0.0",
"postcss-loader": "^1.0.0",
"postcss-loader": "^2.0.8",
"postcss-nested": "^1.0.0",
"react-dnd-test-backend": "^2.5.1",
"redux-devtools": "^3.4.0",
"regenerator-runtime": "^0.10.3",
"rimraf": "^2.5.4",
"semantic-release": "^6.3.2",
"skin-deep": "^0.16.0",
"style-loader": "^0.18.1",
"style-loader": "^0.19.0",
"stylelint": "^7.5.0",
"testcafe": "^0.18.0",
"testcafe-react-selectors": "^1.0.2",
"url-loader": "^0.5.9",
"url-loader": "^0.6.2",
"watch": "^1.0.2",
"webpack": "^1.13.2",
"webpack-livereload-plugin": "^0.10.0"
"webpack": "^3.8.1",
"webpack-merge": "^4.1.1",
"webpack-livereload-plugin": "^1.0.0"
},
"dependencies": {
"@neos-project/brand": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-neos-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"babel-core": "^6.13.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.20.1",
"babel-plugin-webpack-alias": "^2.1.1",
"babel-plugin-webpack-alias": "^2.1.2",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13"
Expand Down
12 changes: 6 additions & 6 deletions packages/build-essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
"@neos-project/brand": "^1.1.0",
"babel-core": "^6.13.2",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.4.1",
"babel-loader": "^7.1.2",
"check-dependencies": "^1.0.1",
"cpx": "^1.3.1",
"cross-env": "^3.0.0",
"eslint": "^3.1.1",
"extract-text-webpack-plugin": "^1.0.1",
"extract-text-webpack-plugin": "^3.0.2",
"greenkeeper-postpublish": "^1.0.0",
"postcss-css-variables": "^0.7.0",
"postcss-hexrgba": "^0.2.0",
"postcss-import": "^10.0.0",
"postcss-loader": "^1.0.0",
"postcss-loader": "^2.0.8",
"postcss-nested": "^1.0.0",
"rimraf": "^2.5.4",
"stylelint": "^7.5.0",
"url-loader": "^0.5.9",
"url-loader": "^0.6.2",
"watch": "^1.0.2",
"webpack": "^1.13.2",
"webpack-livereload-plugin": "^0.10.0"
"webpack": "^3.8.1",
"webpack-livereload-plugin": "^1.0.0"
},
"license": "GNU GPLv3"
}
37 changes: 37 additions & 0 deletions packages/build-essentials/src/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// ToDo: Usually this file would be named `postcss.config.js`, but we had to
// rename it since the postcss-loader of webpack expected to find it on a higher level(?),
// revisit later on and name the file accordingly.
const brand = require('@neos-project/brand');
const brandVars = brand.generateCssVarsObject(brand.config, 'brand');

module.exports = {
plugins: [
require('autoprefixer')({
browsers: ['last 2 versions']
}),
require('postcss-css-variables')({
variables: Object.assign({
//
// Spacings
//
'--goldenUnit': '40px',
'--spacing': '16px',
'--halfSpacing': '8px',
'--quarterSpacing': '4px',

//
// Sizes
//
'--sidebarWidth': '320px',

//
// Font sizes
//
'--baseFontSize': '14px'
}, brandVars)
}),
require('postcss-import')(),
require('postcss-nested')(),
require('postcss-hexrgba')()
]
}
88 changes: 44 additions & 44 deletions packages/build-essentials/src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,93 +3,93 @@ const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const LiveReloadPlugin = require('webpack-livereload-plugin');
const env = require('./environment');
const brand = require('@neos-project/brand');

//
// Prevent from failing, when NEOS_BUILD_ROOT env variable isn't set
// (e.g. when extending this config from storybook)
//
const rootPath = env.rootPath || __dirname;

//
// Create the vars object for brand vars like colors and font settings
// for the `postcss-css-variables` plugin.
//
const brandVars = brand.generateCssVarsObject(brand.config, 'brand');
const extractCss = new ExtractTextPlugin({
filename: '[name].[contenthash].css'
});

const webpackConfig = {
// https://github.com/webpack/docs/wiki/build-performance#sourcemaps
devtool: 'source-map',
module: {
loaders: [
rules: [
{
test: /\.js$/,
exclude: /node_modules\/((?!@neos-project).)*$/,
loader: 'babel'
use: [{
loader: 'babel-loader'
}]
},
{
test: /\.json$/,
exclude: /node_modules\/((?!@neos-project).)*$/,
loader: 'json-loader'
use: [{
loader: 'json-loader'
}]
},
{
test: /\.(woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=10000&name=./Styles/Font-[hash].[ext]&publicPath=./../'
use: [{
loader: 'url-loader',
options: {
limit: 10000,
name: './Styles/Font-[hash].[ext]',
publicPath: './../'
}
}]
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader')
use: extractCss.extract({
use: [{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
}, {
loader: 'postcss-loader',
options: {
config: {
path: path.join(__dirname, 'postcss.config.js')
}
}
}],
fallback: 'style-loader'
})
},
{
test: /\.vanilla-css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
loader: extractCss.extract({
use: [{
loader: 'css-loader'
}],
fallback: 'style-loader'
})
}
]
},

postcss: [
require('autoprefixer')({
browsers: ['last 2 versions']
}),
require('postcss-css-variables')({
variables: Object.assign({
//
// Spacings
//
'--goldenUnit': '40px',
'--spacing': '16px',
'--halfSpacing': '8px',
'--quarterSpacing': '4px',

//
// Sizes
//
'--sidebarWidth': '320px',

//
// Font sizes
//
'--baseFontSize': '14px'
}, brandVars)
}),
require('postcss-import')(),
require('postcss-nested')(),
require('postcss-hexrgba')()
],

plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin('./Styles/[name].css', {allChunks: true}),
new webpack.optimize.CommonsChunkPlugin({names: ['Vendor']})
],

resolve: {
modulesDirectories: [
modules: [
path.resolve(rootPath, './node_modules')
]
},
Expand Down
117 changes: 0 additions & 117 deletions packages/neos-ui-editors/webpack.config.js

This file was deleted.

Loading

0 comments on commit f421380

Please sign in to comment.