Skip to content

Commit

Permalink
Add webpack with postcss and imagemin
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Jan 26, 2017
1 parent 2eeef92 commit ba909ed
Show file tree
Hide file tree
Showing 51 changed files with 83 additions and 733 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/collective/behavior/featuredimage/static/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/collective/behavior/featuredimage/static/main.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/collective/behavior/featuredimage/static/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/collective/behavior/featuredimage/static/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions webpack/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
yarn.lock
File renamed without changes
2 changes: 2 additions & 0 deletions webpack/app/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'styles/featuredimage.css';
@import 'styles/behaviorform.css';
2 changes: 2 additions & 0 deletions webpack/app/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './main.css';
import './images/featuredimage-icon.png';
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions webpack/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "collective.behavior.featuredimage",
"version": "0.0.1",
"main": "app/main.js",
"scripts": {
"dev": "./node_modules/.bin/webpack",
"build": "./node_modules/.bin/webpack -p",
"watch": "./node_modules/.bin/webpack --watch"
},
"repository": {},
"license": "GPLv2",
"devDependencies": {
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "^2.0.0-beta",
"file-loader": "^0.9.0",
"image-webpack-loader": "^3.1.0",
"postcss": "^5.2.11",
"postcss-cssnext": "^2.9.0",
"postcss-import": "^9.1.0",
"postcss-loader": "^1.2.2",
"postcss-nested": "^1.0.0",
"webpack": "^2"
}
}
9 changes: 9 additions & 0 deletions webpack/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
plugins: {
'postcss-import': {},
'postcss-nested': {},
'postcss-cssnext': {
browsers: 'last 3 versions'
},
},
};
38 changes: 38 additions & 0 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './app/main.js',
output: {
filename: 'main.js',
path: '../src/collective/behavior/featuredimage/static'
},
module: {
rules: [{
test: /\.css$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract({
loader: 'css-loader?importLoaders=1!postcss-loader'
})
}, {
test: /.*\.(gif|png|jpe?g|svg)$/i,
loaders: [
'file-loader?name=[name].[ext]',
{
loader: 'image-webpack-loader',
query: {
progressive: true,
optimizationLevel: 7,
interlaced: false,
pngquant: {
quality: '65-90',
speed: 4
}
}
}
]
}]
},
devtool: 'source-map',
plugins: [
new ExtractTextPlugin({ filename: 'main.css', disable: false, allChunks: true })
]
}
3 changes: 0 additions & 3 deletions yeoman/.bowerrc

This file was deleted.

21 changes: 0 additions & 21 deletions yeoman/.editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion yeoman/.gitattributes

This file was deleted.

7 changes: 0 additions & 7 deletions yeoman/.gitignore

This file was deleted.

34 changes: 0 additions & 34 deletions yeoman/.jshintrc

This file was deleted.

12 changes: 0 additions & 12 deletions yeoman/.yo-rc.json

This file was deleted.

95 changes: 0 additions & 95 deletions yeoman/Gruntfile.js

This file was deleted.

19 changes: 0 additions & 19 deletions yeoman/app/index.html

This file was deleted.

23 changes: 0 additions & 23 deletions yeoman/app/scripts/main.js

This file was deleted.

3 changes: 0 additions & 3 deletions yeoman/app/scripts/templates/behaviorform.ejs

This file was deleted.

73 changes: 0 additions & 73 deletions yeoman/app/scripts/views/behaviorform.js

This file was deleted.

Loading

0 comments on commit ba909ed

Please sign in to comment.