Skip to content

Commit

Permalink
different conficuration for babel, separate script for building intl …
Browse files Browse the repository at this point in the history
…messages
  • Loading branch information
DaryaTarasowa committed Oct 5, 2017
1 parent e05fdd1 commit 615a0dc
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 80 deletions.
38 changes: 27 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
{
"presets": ["es2015", "react"],
"plugins": [
"add-module-exports",
"transform-object-rest-spread",
"transform-class-properties",
"syntax-decorators",
"transform-react-constant-elements",
"transform-react-inline-elements",
["react-intl", {
"messagesDir": "./build/messages/"
}],
]
"env": {
"production": {
"plugins": [
"add-module-exports",
"transform-object-rest-spread",
"transform-class-properties",
"syntax-decorators",
"transform-react-constant-elements",
"transform-react-inline-elements",
["react-intl", {
"messagesDir": "./build/messages/"
}]
]
},
"development": {
"plugins": [
"add-module-exports",
"transform-object-rest-spread",
"transform-class-properties",
"transform-react-constant-elements",
"syntax-decorators",
["react-intl", {
"messagesDir": "./build/messages/"
}],
],
}
}
}
68 changes: 1 addition & 67 deletions intl/default.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
{
"header.cookieBanner": "This website uses cookies to ensure you get the best experience on our website.",
"header.signin": "Sign In",
"header.signin.mobile": "Sign in",
"header.mydecks": "My Decks",
"header.mygroups": "My Groups",
"header.mysettings": "My Settings",
"header.mynotifications": "My Notifications",
"header.logout": "Logout",
"header.addDeck": "Add deck",
"header.slidewiki": "SlideWiki",
"header.menu.homepage": "Homepage",
"header.menu.addDeck": "Add Deck",
"carousel.create_alt": "Create slides with SlideWiki.",
"carousel.reuse_alt": "Repurpose & Reuse Educational Content through open educational resources.",
"carousel.collaborative_alt": "Collaborative Content Authoring.",
"carousel.communities_alt": "Supporting Knowledge Communities.",
"carousel.menu.title": "Discover SlideWiki",
"carousel.menu.1": "Create Online Slide Decks",
"carousel.menu.1_desc": "Use our slide creator or import your existing slides to form online HTML slide decks.",
"carousel.menu.2": "Reuseable Educational Content",
"carousel.menu.2_desc": "Discover a wide range of open educational slides and courses.",
"carousel.menu.3": "Collaborative Content Authoring",
"carousel.menu.3_desc": "Create slides online together with peers and colleagues through our collaborative editing features.",
"carousel.menu.4": "Supporting Knowledge Communities",
"carousel.menu.4_desc": "Using our search and tags features discover content and authors who share your interests.",
"contactUs.swal_title": "Contact Us",
"contactUs.checkType_text": "Please select the type of feedback",
"contactUs.swal_button": "Ok",
Expand Down Expand Up @@ -53,51 +28,10 @@
"contactUs.send_swal_button": "Close",
"contactUs.send_swal_error_text": "An error occured while contacting us. Please try again later.",
"contactUs.send_swal_error_button": "Close",
"home.3.step_1": "Use the {strong} to view a deck as a slideshow. Includes a timer and speaker notes' view.",
"home.3.step_2": "{strong} via social media or email.",
"home.3.step_3": "Add {strong} to decks and slides to interact with other learners.",
"home.3.step_4": "{strong} decks in PDF, ePub or SCORM format.",
"home.findout_desc": "SlideWiki is an open source development project, funded from the European Union's Horizon 2020 research and innovation programme. The project involves 17 partners to develop, test and trial SlideWiki. To find out more or get involved visit the {link}.",
"home.slogan": "SlideWiki...Create, Share and Enjoy Presentations",
"home.welcome": "Welcome to SlideWiki",
"home.1": "1. Create a deck",
"home.create": "Start creating your own slide deck by selecting the Add deck button.",
"home.add_button": "Add deck",
"home.create_desc1": "Create a new deck or import existing slides from PowerPoint (*.pptx) or OpenDocument Presentation (*.odp) files. Your imported slides will be converted into HTML slides to allow you to continue to edit and add new slides.",
"home.create_desc2": "Need more inspiration to make your own slides? Why not search or browse throughexisting SlideWiki decks.",
"home.2": "2. Reuse, Repurpose and Collaborate",
"home.reuse": "Want to enhance your decks? SlideWiki allows you to create your own slides based on decks that have been published on SlideWiki.",
"home.reuse_step1": "Create a copy of a deck",
"home.reuse_step1_desc": "Use the Fork function to create your own copy of an existing deck.",
"home.reuse_step2": "Append slides and decks to your deck",
"home.reuse_step2_desc": "Add slides from other decks using the Append function. Or Append a deck to embed a set of slides as a sub-deck.",
"home.reuse_step3": "Collaborate to improve your deck",
"home.reuse_step3_desc": "Use Groups to allow colleagues, peers and associates to collaborate with editing and enhancing your deck.",
"home.3": "3. Present, Share and Communicate",
"home.3.desc": "There are many ways that you and your students can engage and interact with slides and decks.",
"home.3.strong1": "Presentation mode",
"home.3.strong2": "Share decks",
"home.3.strong3": "Comments",
"home.3.strong4": "Download",
"home.start": "Get Started",
"home.signup": "Sign up for a SlideWiki account",
"home.signup_desc": "Create an account to start creating and sharing your decks",
"home.learn": "Learn about SlideWiki",
"home.learn_desc": "Find out more about SlideWiki's features and how it can be used to create, share and adapt slides, decks and open educational resources.",
"home.findout": "Find out about the SlideWiki project",
"home.linlk_project": "project webiste",
"home.featured": "Featured decks",
"userSignIn.errormessage.isSPAM": "Your account was marked as SPAM thus you are not able to sign in. Contact us directly for reactivation.",
"userSignIn.errormessage.notFound": "The credentials are unknown. Please retry with another input.",
"userSignIn.errormessage.deactivatedOrUnactivated": "Your user account either have to be activated via the activation link in your email or is deactivated in general.",
"LoginModal.text.incompleteProviderData": "The data from {provider} was incomplete. In case you want to use this provider, please add an e-mail address at the provider itself and try again at SlideWiki.",
"LoginModal.placeholder.email": "E-Mail",
"LoginModal.placeholder.password": "Password",
"LoginModal.header.signIn": "Sign In",
"LoginModal.label.email": "E-Mail",
"LoginModal.label.password": "Password",
"LoginModal.button.signIn": "Sign In",
"LoginModal.text.iCannotAccessMyAccount": "I can not access my account",
"LoginModal.text.dontHaveAnAccount": "Don't have an account? Sign up here.",
"LoginModal.button.close": "Close"
"LoginModal.placeholder.password": "Password"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"clean": "rm -rf build/ coverage/",
"start": "node start.js",
"build": "webpack --config ./webpack/prod.config.js && NODE_ENV=production npm start",
"build:windows": "webpack --config ./webpack/prod.config.js && set NODE_ENV=production && npm start",
"build:windows": "webpack --config ./webpack/prod.config.js && set NODE_ENV=production && set BABEL_ENV=production && npm start",
"build:nostart": "webpack --config ./webpack/prod.config.js",
"build:langs": "babel plugins/intl/translate.js | node",
"dev": "node ./webpack/dev-server.js",
"dev:dashboard": "DASHBOARD=1 webpack-dashboard -- webpack-dev-server --config ./webpack/dev-server.js",
"dev:windows:dashboard": "set HOST=127.0.0.1&& set PORT=3000&& set DASHBOARD=1&& webpack-dashboard -- webpack-dev-server --config ./webpack/dev-server.js",
"dev:windows": "set HOST=127.0.0.1&& set PORT=3000&& node ./webpack/dev-server.js",
"langs": "babel plugins/intl/translate.js | node",
"lint": "eslint --ignore-path .gitignore -c .eslintrc \"./**/*.js\"",
"test": "mocha test/unit/ --recursive --compilers js:babel-register --reporter spec",
"coverage": "istanbul cover _mocha --include-all-sources tests/unit/*.js",
Expand All @@ -42,6 +42,7 @@
"validate": "npm ls",
"pull": "git pull --recurse-submodules",
"precommit": "npm run lint",
"prelangs": "webpack --config ./webpack/langs.config.js && set NODE_ENV=development && set BABEL_ENV=development",
"windows": "webpack --config ./webpack/prod.config.js && set NODE_ENV=production && npm start"
},
"napa": {
Expand Down
105 changes: 105 additions & 0 deletions webpack/langs.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
let webpack = require('webpack');
let path = require('path');
let StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
let Visualizer = require('webpack-visualizer-plugin');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let ReactIntlPlugin = require('react-intl-webpack-plugin');

let webpackConfig = {
resolve: {
extensions: ['.js']
},
entry: {
main: [
'./client.js'
],
vendor: [
'react-intl', 'react', 'react-dom', 'semantic-ui-react', 'react-hotkeys', 'react-list', 'react-responsive', 'react-custom-scrollbars', 'react-resize-aware', 'async', 'immutable', 'classnames', 'fluxible', 'fluxible-addons-react', 'fluxible-plugin-fetchr', 'fluxible-router', 'react-google-recaptcha', 'identicons-react', 'iso-639-1', 'lodash', 'cheerio', 'react-dnd', 'react-dnd-html5-backend', 'striptags', 'js-sha512', 'debug', 'md5', 'js-cookie', 'cookie', 'fumble', 'crypt'
]
},
output: {
path: path.resolve('./build/js'),
publicPath: '/public/js/',
filename: '[name].js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules\/(?!identicons)/ ,
loader: 'babel-loader'
},
// Getting URLs for font files otherwise we get encoding errors in css-loader
{ test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, loader: 'file-loader'},// 'url-loader?limit=100000'},
{
test: /\.css$/,
exclude: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader?modules&importLoaders=1&localIdentName=[hash:base64:5]'
],
// use: 'css-loader',
// options: {importLoaders: 1, modules: true},
publicPath: '/public/css/'
})
},
// { test: /\.css$/,
// use: [
// {
// loader: 'style-loader'
// },
// {
// loader: 'css-loader'
// }
// ]
// },

]
},
node: {
setImmediate: false
},
plugins: [
//collect all messages into one json
new ReactIntlPlugin(),
// css files from the extract-text-plugin loader
new ExtractTextPlugin({
filename: '../css/vendor.bundle.css',
disable: false,
allChunks: true
}),

new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
// Mainly used to require CSS files with webpack, which can happen only on browser
// Used as `if (process.env.BROWSER)...`
BROWSER: JSON.stringify(true),
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
filename: '[name].bundle.js'
}),
// Write out stats file to build directory.
new StatsWriterPlugin({
filename: 'webpack.stats.json', // Default
fields: null,
transform: function (data) {
return JSON.stringify(data, null, 2);
}
}),
new Visualizer()
],
devtool: 'source-map'
};

module.exports = webpackConfig;

0 comments on commit 615a0dc

Please sign in to comment.