Skip to content

Commit

Permalink
Add support for symlinks in webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Feb 25, 2018
1 parent d4f98aa commit 8676b84
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable */

const fs = require('fs');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
Expand All @@ -11,6 +12,9 @@ const path = require('path');

const redashBackend = process.env.REDASH_BACKEND || 'http://localhost:5000';

const basePath = fs.realpathSync(path.join(__dirname, 'client'));
const appPath = fs.realpathSync(path.join(__dirname, 'client', 'app'));

const config = {
entry: {
app: [
Expand All @@ -22,13 +26,13 @@ const config = {
],
},
output: {
path: path.join(__dirname, 'client', 'dist'),
path: path.join(basePath, './dist'),
filename: '[name].js',
publicPath: '/static/'
},
resolve: {
alias: {
'@': path.join(__dirname, 'client/app')
'@': appPath
}
},
plugins: [
Expand Down Expand Up @@ -126,7 +130,7 @@ const config = {
use: [{
loader: 'file-loader',
options: {
context: path.resolve(__dirname, './client/app/assets/images/'),
context: path.resolve(appPath, './assets/images/'),
outputPath: 'images/',
name: '[path][name].[ext]',
}
Expand Down

0 comments on commit 8676b84

Please sign in to comment.