Skip to content

Commit

Permalink
pkg: upgrade to v1.4
Browse files Browse the repository at this point in the history
* Uses new @sajari/sdk-react v2.3.1
* Adds localization
* Removes css file from dist
* Adds styling and theming to config object
* Adds inputMode member to config object, allows for
typeahead/InstantSearch to be enabled

JRA AA-15

Change-Id: I42400e96edc8e80b47f7062f31e64a8ccfeeccb9
Reviewed-on: https://review.sajari.com/182
Reviewed-by: Trent Billington <tbillington@sajari.com>
Reviewed-by: David Howden <dhowden@sajari.com>
Tested-by: David Howden <dhowden@sajari.com>
  • Loading branch information
Benjamin Hinchley authored and dhowden committed Aug 1, 2018
1 parent 2bb968f commit fe21b32
Show file tree
Hide file tree
Showing 50 changed files with 7,228 additions and 19,432 deletions.
11 changes: 9 additions & 2 deletions .babelrc
@@ -1,6 +1,7 @@
{
"presets": [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": [
">0.25%",
Expand All @@ -9,7 +10,13 @@
]
}
}],
"@babel/preset-react",
"@babel/preset-stage-3"
"@babel/react",
"@babel/typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/syntax-dynamic-import",
"babel-plugin-idx"
]
}
8 changes: 0 additions & 8 deletions config/postcss.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions config/webpack.analyze.js
@@ -1,8 +1,7 @@
const merge = require("webpack-merge");
const config = require("./webpack.config");

const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");

module.exports = merge(config, {
plugins: [new BundleAnalyzerPlugin()]
Expand Down
40 changes: 7 additions & 33 deletions config/webpack.config.js
@@ -1,53 +1,27 @@
const { resolve } = require("path");

const ExtractTextPlugin = require("extract-text-webpack-plugin");

const VERSION = require("../package.json").version;
const VERSION = require("../package.json").version.split(".");
const [VERSION_MAJOR, VERSION_MINOR] = VERSION;

module.exports = {
target: "web",
entry: {
"website-search": resolve(__dirname, "../src/index.js")
"website-search": resolve(__dirname, "../src/index.ts")
},
output: {
path: resolve(__dirname, "../dist"),
filename: `[name]-${VERSION}.js`
filename: `[name]-${VERSION_MAJOR}.${VERSION_MINOR}.js`
},
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: {
loader: "postcss-loader",
options: {
config: {
path: resolve(__dirname, "./postcss.config.js")
}
}
}
})
},
{
test: /\.js$/,
test: [/\.js$/, /\.tsx?/],
exclude: [/node_modules/],
use: ["babel-loader"]
use: "babel-loader"
}
]
},
plugins: [new ExtractTextPlugin(`[name]-${VERSION}.css`)],
resolve: {
extensions: [".js"],
alias: {
react: "preact-compat",
"react-dom": "preact-compat",
"create-react-class": "preact-compat/lib/create-react-class"

// So we load the ES6 module versions, without having to rewrite our import
// statements.
// sajari$: resolve(__dirname, "../node_modules/sajari/dist.es/main.js"),
// "sajari-react": resolve(__dirname, "../node_modules/sajari-react/es")
}
extensions: [".js", ".ts", ".tsx"]
}
};
5 changes: 1 addition & 4 deletions config/webpack.dev.js
Expand Up @@ -17,8 +17,5 @@ module.exports = merge(config, {
new HtmlWebpackPlugin({
template: resolve(__dirname, `../public/${argv.integration}.html`)
})
],
serve: {
content: resolve(__dirname, "../dist")
}
]
});

0 comments on commit fe21b32

Please sign in to comment.