Skip to content

Commit

Permalink
Vendor in blueimp-load-image and add browser directive for Faye (#384)
Browse files Browse the repository at this point in the history
* fix ignoring lib path

* vendor in blueimp-load-image and remove amd loader from it

* add browser directive for faye

* remove webpack directives for load-image

* remove notes about load-image in README
  • Loading branch information
lemieux committed Aug 30, 2016
1 parent 1729157 commit 0f42db8
Show file tree
Hide file tree
Showing 10 changed files with 1,343 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ node_modules
bower_components
*.log
tmp
dist/
lib/
/dist/
/lib/
grunt-aws.json
grunt-maxcdn.json
*.sublime-workspace
Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,7 @@ Smooch.init({appToken: 'your_app_token'});
```

#### Notes about Webpack
Since not all Smooch JS dependencies are "webpack-friendly", you might want to tweak your config a bit.

You will need to disable AMD support for `blueimp-load-image` by adding the following snippet to your loaders :

```javascript
{
test: /load-image/,
loader: 'imports?define=>false'
}
```

Also, if you are building an isomorphic app, make sure you init the widget in client code only. It currently won't work on the server side. You'll also need to add the following to your plugins since `iconv-loader` doesn't work very well with webpack :
If you are building an isomorphic app, make sure you init the widget in client code only. It currently won't work on the server side. You'll also need to add the following to your plugins since `iconv-loader` doesn't work very well with webpack :

```javascript
new webpack.NormalModuleReplacementPlugin(/\/iconv-loader$/, 'node-noop')
Expand Down
7 changes: 1 addition & 6 deletions make-webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ module.exports = function(options) {
'css': cssLoader,
'less': [cssLoader, 'less-loader']
};
var additionalLoaders = [
{
test: /load-image/,
loader: 'imports?define=>false'
}
];
var additionalLoaders = [];

var alias = {};

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"homepage": "https://smooch.io",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"blueimp-load-image": "2.6.0",
"deep-equal": "1.0.1",
"faye": "1.1.2",
"ismobilejs": "0.3.9",
Expand Down Expand Up @@ -149,5 +148,8 @@
"babel-runtime": "6.9.x",
"react": "15.x.x",
"react-dom": "15.x.x"
},
"browser": {
"faye": "faye/browser/faye-browser"
}
}
Loading

0 comments on commit 0f42db8

Please sign in to comment.