Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Support .jsx files.
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Jul 17, 2018
1 parent 052a605 commit 9f467f7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function requireImages() {
function registerComponents() {
// We repeat this code in other register functions, because if we don't use a literal for the path
// Webpack won't be able to statcily analyze our imports.
const context = require.context('@/components', true, /^((?![\\/]test[\\/]).)*\.js$/);
const context = require.context('@/components', true, /^((?![\\/]test[\\/]).)*\.jsx?$/);
registerAll(context);
}

Expand Down
21 changes: 16 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const WebpackBuildNotifierPlugin = require("webpack-build-notifier");
const ManifestPlugin = require("webpack-manifest-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const LessPluginAutoPrefix = require("less-plugin-autoprefix");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
const path = require("path");

const redashBackend = process.env.REDASH_BACKEND || "http://localhost:5000";
Expand All @@ -28,7 +29,7 @@ const config = {
},
resolve: {
alias: {
"@": appPath,
"@": appPath
}
},
plugins: [
Expand Down Expand Up @@ -83,7 +84,7 @@ const config = {
module: {
rules: [
{
test: /\.js$/,
test: /\.jsx?$/,
exclude: /node_modules/,
use: ["babel-loader", "eslint-loader"]
},
Expand Down Expand Up @@ -119,7 +120,9 @@ const config = {
{
loader: "less-loader",
options: {
plugins: [new LessPluginAutoPrefix({ browsers: ["last 3 versions"] })]
plugins: [
new LessPluginAutoPrefix({ browsers: ["last 3 versions"] })
]
}
}
])
Expand Down Expand Up @@ -182,7 +185,15 @@ const config = {
publicPath: "/static/",
proxy: [
{
context: ["/login", "/logout", "/invite", "/setup", "/status.json", "/api", "/oauth"],
context: [
"/login",
"/logout",
"/invite",
"/setup",
"/status.json",
"/api",
"/oauth"
],
target: redashBackend + "/",
changeOrigin: false,
secure: false
Expand Down

0 comments on commit 9f467f7

Please sign in to comment.