Skip to content

Instantly share code, notes, and snippets.

@chrisschreiner
Last active April 13, 2016 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisschreiner/eb1b36c86dd89029aa779400a824d4ad to your computer and use it in GitHub Desktop.
Save chrisschreiner/eb1b36c86dd89029aa779400a824d4ad to your computer and use it in GitHub Desktop.
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
resolveLoader: {
root: __dirname + "/node_modules"
},
plugins: [
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
}),
new ExtractTextPlugin("[name].css", {allChunks: true})
],
entry: [
'./src/css/sample.scss',
"./src/index.tsx",
],
output: {
filename: "./dist/bundle.js",
},
devtool: "source-map",
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js", ".scss"]
},
module: {
loaders: [
{
test: /\.tsx?$/,
loader: "ts-loader"
},
{
test: /\.scss$/,
exlude: /node_modules/,
include: './src/css',
loader: ['style', 'css', 'sass']
}
],
preLoaders: [
{ test: /\.js$/, loader: "source-map-loader" }
]
},
externals: {
"react": "React",
"react-dom": "ReactDOM"
},
};
body {
background: #f00;
}
question {
display: flex;
padding: 1em;
}
searchbox {
display: flex;
background: red;
margin: 1em;
padding: 1em;
border: solid 1px black;
width: 300px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment