Commit e8f78555 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Update use of webpack 4 and more recent babel

parent 10a2f86d
{
"presets": ["es2015","react", "stage-2"]
"presets": ["env", "react"]
}
This diff is collapsed.
......@@ -5,56 +5,56 @@
"main": "",
"scripts": {
"start": "node server",
"dev": "webpack-dev-server --content-base public --config ./webpack.dev.config.js --host 0.0.0.0 ",
"dev": "webpack-dev-server --content-base public --config ./webpack.dev.config.js --host 127.0.0.1 ",
"build": "webpack --display-error-details -d",
"build:prod": "webpack -p --config ./webpack.prod.config.js"
},
"author": "Andreas Åkre Solberg <andreas.solberg@uninett.no>",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.7.2",
"babel-eslint": "^7.2.3",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-2": "^6.24.1",
"css-loader": "^0.23.1",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"eslint": "^3.19.0",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^0.11.2",
"html-webpack-plugin": "^2.30.1",
"style-loader": "^0.13.0",
"url-loader": "^0.5.9",
"webpack": "^3.11.0",
"webpack-dev-server": "^2.11.2"
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.0.7",
"mini-css-extract-plugin": "^0.2.0",
"style-loader": "^0.20.3",
"url-loader": "^1.0.1",
"webpack": "^4.1.1",
"webpack-dev-server": "^3.1.1"
},
"dependencies": {
"axios": "^0.16.2",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-polyfill": "^6.23.0",
"bootstrap": "^3.3.7",
"dotenv": "^4.0.0",
"express": "^4.15.4",
"extract-text-webpack-plugin": "^3.0.0",
"history": "^4.6.3",
"express": "^4.16.3",
"history": "^4.7.2",
"jso": "^4.0.0-rc.3",
"jwt-decode": "^2.2.0",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"react": "^15.6.1",
"react-bootstrap": "^0.31.2",
"react-dom": "^15.6.1",
"lodash": "^4.17.5",
"moment": "^2.21.0",
"react": "^15.6.2",
"react-bootstrap": "^0.31.5",
"react-dom": "^15.6.2",
"react-fontawesome": "^1.6.1",
"react-redux": "^5.0.5",
"react-remarkable": "^1.1.1",
"react-redux": "^5.0.7",
"react-remarkable": "^1.1.3",
"redux": "^3.7.1",
"redux-actions": "^2.2.1",
"redux-actions": "^2.3.0",
"redux-localstorage": "^0.4.1",
"redux-promise": "^0.5.3",
"redux-thunk": "^2.2.0",
"uninett-bootstrap-theme": "^1.0.1"
"uninett-bootstrap-theme": "^1.0.1",
"webpack-cli": "^2.0.12"
}
}
import actions from '../actions/'
// import jso from '../../lib/jso'
import {JSO, Popup} from 'jso'
const baseURL = 'https://prefstore.dataporten-api.no'
......@@ -14,14 +12,15 @@ class Authenticator {
authenticateORCID() {
this.jso.wipeTokens()
return this.jso.getToken({})
return this.jso.getToken()
.then((token) => {
return {}
})
return {}
})
}
authenticate() {
let opts = {}
opts.redirect_uri = 'http://0.0.0.0:8080/passiveResponse.html'
return this.jso.getToken(opts)
.then((token) => {
// console.error("Get Token returned ", token)
......
......@@ -4,7 +4,8 @@ const dotenv = require('dotenv').config()
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
// const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
module.exports = {
......@@ -37,10 +38,7 @@ module.exports = {
limit: 10000
}
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.js[x]?$/,
exclude: (/node_modules/),
......@@ -49,6 +47,13 @@ module.exports = {
presets: ['es2015', 'react', 'stage-2'],
plugins: ['transform-es2015-spread']
}
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader"
]
}
]
},
......@@ -64,6 +69,12 @@ module.exports = {
inject: 'body'
}),
new webpack.EnvironmentPlugin(["API_URL", "REDIRECT_URL", "CLIENT_ID"]),
new ExtractTextPlugin('style.css'),
// new ExtractTextPlugin('style.css'),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css"
})
]
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment