Last active
October 13, 2016 04:35
-
-
Save bvanderlugt/a511a0e5c063a4e6f7f1bf7b6b7a9f2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# React webpack and sass | |
# depends on: npm babel webpack weback-dev-server -g | |
npm init | |
npm install react react-dom --save | |
npm install babel-loader babel-core babel-preset-es2015 babel-preset-react | |
# for a simple project make a directory structure like so | |
touch index.html App.js main.js webpack.config.js | |
## webpack.config.js using sass loader | |
``` | |
module.exports = { | |
entry: './main.js', | |
output: { | |
path: './', | |
filename: 'index.js' | |
}, | |
devServer: { | |
inline: true, | |
port: 3333 | |
}, | |
module: { | |
loaders: [{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel', | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
}, { | |
test: /\.scss$/, | |
loaders: ["style", "css", "sass"] | |
}] | |
} | |
} | |
``` | |
# Add to start in package.json | |
``` | |
"start": "webpack-dev-server" | |
``` | |
## SASS(y) thangs | |
npm install --save-dev sass-loader css-loader style-loader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment