unsplash-js
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -1,13 +0,4 @@ | ||
import Unsplash, { toJson } from "unsplash-js"; | ||
require('es6-promise').polyfill(); | ||
require('whatwg-fetch'); | ||
let unsplash = new Unsplash({ | ||
applicationId: "{YOUR_APPLICATION_ID}", | ||
secret: "{YOUR_SECRET}", | ||
callbackUrl: "{YOUR_CALLBACK_URL}" | ||
}); | ||
unsplash.users.profile("naoufal") | ||
.then(toJson) | ||
.then(json => { | ||
console.log(json); | ||
}); | ||
require('./main'); |
@@ -1,15 +0,15 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
var path = require("path"); | ||
var webpack = require("webpack"); | ||
module.exports = { | ||
devtool: 'eval', | ||
devtool: "eval", | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./index' | ||
"webpack-dev-server/client?http://localhost:3000", | ||
"webpack/hot/only-dev-server", | ||
"./index" | ||
], | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'bundle.js', | ||
publicPath: '/static/' | ||
path: path.join(__dirname, "dist"), | ||
filename: "bundle.js", | ||
publicPath: "/static/" | ||
}, | ||
@@ -19,11 +19,3 @@ plugins: [ | ||
new webpack.NoErrorsPlugin(), | ||
new webpack.DefinePlugin({ | ||
'Promise': 'es6-promise', | ||
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch', | ||
'process': { | ||
'browser': true | ||
} | ||
}), | ||
new webpack.IgnorePlugin(/^form-data/), | ||
new webpack.IgnorePlugin(/^node-fetch/), | ||
new webpack.IgnorePlugin(/node-fetch/) | ||
], | ||
@@ -33,3 +25,3 @@ module: { | ||
test: /\.js$/, | ||
loaders: ['babel-loader'], | ||
loaders: ["babel-loader"], | ||
exclude: /node_modules/, | ||
@@ -36,0 +28,0 @@ include: __dirname |
{ | ||
"name": "unsplash-js", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "A Universal JavaScript wrapper for the Unsplash API", | ||
@@ -5,0 +5,0 @@ "main": "lib/unsplash.js", |
"use strict"; | ||
const webpack = require("webpack"); | ||
module.exports = { | ||
output: { | ||
library: "Unsplash", | ||
libraryTarget: "umd" | ||
}, | ||
module: { | ||
@@ -9,14 +15,8 @@ loaders: [ | ||
}, | ||
output: { | ||
library: "Unsplash", | ||
libraryTarget: "umd" | ||
}, | ||
externals: [{ | ||
"whatwg-fetch": { | ||
root: "fetch", | ||
commonjs2: "whatwg-fetch", | ||
commonjs: "whatwg-fetch", | ||
amd: "whatwg-fetch" | ||
} | ||
}] | ||
plugins: [ | ||
new webpack.IgnorePlugin(/node-fetch/), | ||
new webpack.DefinePlugin({ | ||
"process.browser": true | ||
}) | ||
] | ||
}; |
44
96273
2014