Project setup with webpack and PostCSS

This commit is contained in:
paritosh_pundir 2017-08-21 00:43:38 +05:30
parent 88f03612b0
commit 624f30b03c
8 changed files with 3221 additions and 2 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
.DS_Store .DS_Store
node_modules

2
css/skeleton.css vendored
View File

@ -1,5 +1,5 @@
/* /*
* Skeleton V2.0.4 * Skeleton V3.0.1 alpha
* Copyright 2014, Dave Gamache * Copyright 2014, Dave Gamache
* www.getskeleton.com * www.getskeleton.com
* Free to use under the MIT license. * Free to use under the MIT license.

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"dependencies": {
"postcss-loader": "^2.0.6"
},
"devDependencies": {
"css-loader": "^0.28.5",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"postcss": "^6.0.9",
"postcss-cssnext": "^3.0.2",
"postcss-import": "^10.0.0",
"webpack": "^3.5.5"
}
}

8
postcss.config.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
plugins: {
'postcss-import': {},
'postcss-cssnext': {
browsers: ['last 2 versions', '> 5%'],
},
},
};

1
src/index.js Normal file
View File

@ -0,0 +1 @@
import styles from './main.css';

0
src/main.css Normal file
View File

32
webpack.config.js Normal file
View File

@ -0,0 +1,32 @@
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: {
app: './index.js',
},
module: {
loaders: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
options: { importLoaders: 1 },
},
'postcss-loader',
],
}),
},
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js',
},
plugins: [
new ExtractTextPlugin('skeleton.css'),
],
}

3163
yarn.lock Normal file

File diff suppressed because it is too large Load Diff