Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The PatternFly demo app serves as a boiler for building your production app with [PatternFly](http://patternfly.org/), [Node.JS](https://nodejs.org/en/), and [Webpack](https://webpack.github.io/).

![Image of PatternFly](https://avatars2.githubusercontent.com/u/6391110?v=3&s=400)
![Image of NodeJS](http://www.devsensation.es/sites/default/files/styles/large/public/field/image/nodejs-logo.png?itok=URP6hUpT)
![Image of Webpack](https://avatars0.githubusercontent.com/webpack?&s=256)
![Image of NodeJS](https://avatars0.githubusercontent.com/nodejs?&s=148)
![Image of Webpack](https://avatars0.githubusercontent.com/webpack?&s=190)

## Demo
The main demo can be found [here](https://rawgit.com/patternfly/patternfly-demo-app/master/dist/index.html). There is a sample [login](https://rawgit.com/patternfly/patternfly-demo-app/master/dist/login.html) page as well.
Expand Down
53 changes: 41 additions & 12 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var ExtractTextPlugin = require("extract-text-webpack-plugin");
var WriteFilesPlugin = require('write-file-webpack-plugin');

module.exports = {
debug: true,

devtool: 'source-map',

Expand All @@ -33,17 +32,13 @@ module.exports = {

plugins: [
// Avoid publishing files when compilation failed:
new webpack.NoErrorsPlugin(),
new webpack.NoEmitOnErrorsPlugin(),

//optimizes webpack id order
new webpack.optimize.OccurenceOrderPlugin(),
//optimizes webpack id order OccurrenceOrderPlugin enabled by default

//HMR
new webpack.HotModuleReplacementPlugin(),

// Remove duplicate modules (should they occur):
new webpack.optimize.DedupePlugin(),

//make webpack ignore moment locale require: https://github.com/moment/moment/issues/2517
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),

Expand Down Expand Up @@ -79,14 +74,21 @@ module.exports = {
]),

//creates distribution css file rather than inlining styles
new ExtractTextPlugin("[name].css", {allChunks: false}),
new ExtractTextPlugin({
filename: "[name].css",
allChunks: false
}),

//writes files on changes to src
new WriteFilesPlugin()
new WriteFilesPlugin(),

new webpack.LoaderOptionsPlugin({
debug: true
})
],

module: {
loaders: [
rules: [
//js loader
{
loader: "babel-loader",
Expand All @@ -106,11 +108,32 @@ module.exports = {
// bundle LESS and CSS auto-generating -vendor-prefixes
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap")
loader: ExtractTextPlugin.extract({
fallback:"style-loader",
use: [
{ loader: 'css-loader', options: { sourceMap: true } },
]
})
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap!autoprefixer-loader!less-loader")
loader: ExtractTextPlugin.extract({
fallback:"style-loader",
use: [
{ loader: 'css-loader', options: { sourceMap: true, importLoaders: 1 } },
{
loader: 'postcss-loader',
options: {
plugins: () => {
return [
require('autoprefixer')
]
}
}
},
{ loader: 'less-loader', options: { sourceMap: true } }
]
})
},

//font/image url loaders
Expand Down Expand Up @@ -139,5 +162,11 @@ module.exports = {
loader: 'url?limit=100000&name=[name].[ext]'
}
]
},
resolve: {
modules: [
"node_modules/patternfly/node_modules",
"node_modules"
]
}
};
Loading