Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // webpack
- var webpack = require('webpack');
- module.exports = {
- devtool:'source-map',
- entry: [
- './src/index.js',
- ],
- output: {
- path: __dirname,
- publicPath: '/',
- filename: 'bundle.js'
- },
- module: {
- loaders: [
- {
- exclude: /node_modules/,
- loaders: ['react-hot','babel']
- },
- { test: /\.css$/, loader: "style!css" },
- {test: /\.json$/, loader: 'json-loader'},
- {
- test: /\.(jpe?g|png|gif|svg)$/i,
- loaders: [
- 'file?hash=sha512&digest=hex&name=[hash].[ext]',
- 'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
- ]
- },
- {
- test: /masonry|imagesloaded|fizzy\-ui\-utils|desandro\-|outlayer|get\-size|doc\-ready|eventie|eventemitter/,
- loader: 'imports?define=>false&this=>window'
- }
- ]
- },
- resolve: {
- extensions: ['', '.js', '.jsx']
- },
- devServer: {
- port:8080,
- historyApiFallback: true,
- contentBase: './'
- }
- };
- //server
- app.get('/dbmt/*', function(req, res,next) {
- //console.log(path.resolve('../', 'client/dbmt', 'index.html'));
- console.log(req.originalUrl);
- var skip = ['.css','.js','.html'];
- var match = false;
- skip.map(function(ext) {
- if (req.originalUrl.indexOf(ext) > 0) {
- match = true;
- }
- })
- if (match) {
- next();
- } else {
- res.sendFile(path.resolve('../', 'client/dbmt', 'index.html'));
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement