Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- webpack.config.js
- const webpack = require('webpack')
- const path = require('path')
- var ExtractTextPlugin = require('extract-text-webpack-plugin');
- var BUILD_DIR = path.resolve(__dirname, 'src/public');
- var APP_DIR = path.resolve(__dirname, 'src/app');
- module.exports = {
- devtool: 'source-map',
- entry: {
- 'app': [
- 'babel-polyfill',
- 'react-hot-loader/patch',
- './src/app/index.jsx'
- ]
- },
- output: {
- path: BUILD_DIR,
- publicPath: '/public/',
- filename: 'bundle.js'
- },
- module: {
- loaders : [
- {
- test : /\.jsx?/,
- include : APP_DIR,
- loader : 'babel-loader'
- },
- {
- test: /\.scss$/,
- loader: ExtractTextPlugin.extract('css-loader!sass-loader')
- }
- ]
- },
- plugins: [
- new ExtractTextPlugin({
- filename: BUILD_DIR + '/bundle.css',
- allChunks: true
- })
- ]
- }
- package.json
- {
- "name": "( ͡° ͜ʖ ͡°)",
- "version": "1.0.0",
- "description": "",
- "main": "src/app/index.js",
- "scripts": {
- "bundle": "webpack -d",
- "server": "webpack-dev-server --hot --content-base src/ --history-api-fallback --open"
- },
- "author": "( ͡° ͜ʖ ͡°)",
- "license": "MIT",
- "devDependencies": {
- "babel-core": "^6.24.1",
- "babel-loader": "^6.4.1",
- "babel-polyfill": "^6.23.0",
- "babel-preset-latest": "^6.24.1",
- "babel-preset-react": "^6.24.1",
- "css-loader": "^0.28.0",
- "extract-text-webpack-plugin": "^2.1.0",
- "node-sass": "^4.5.2",
- "react-hot-loader": "^3.0.0-beta.6",
- "sass-loader": "^6.0.3",
- "style-loader": "^0.16.1",
- "webpack": "^2.3.3",
- "webpack-dev-server": "^2.4.2"
- },
- "dependencies": {
- "react": "^15.5.4",
- "react-dom": "^15.5.4"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment