mirror of
https://github.com/wassname/talk.git
synced 2026-07-16 11:22:16 +08:00
Merge branch 'master' of github.com:coralproject/talk into community
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
"no-var": [2],
|
||||
"no-lonely-if": [2],
|
||||
"curly": [2],
|
||||
"no-unused-vars": ["error", { "argsIgnorePattern": "next" }],
|
||||
"no-multiple-empty-lines": [
|
||||
"error",
|
||||
{"max": 1}
|
||||
|
||||
@@ -11,14 +11,57 @@ app.use(bodyParser.json());
|
||||
app.set('views', path.join(__dirname, 'views'));
|
||||
app.set('view engine', 'ejs');
|
||||
|
||||
// API Routes.
|
||||
// Routes.
|
||||
app.use('/api/v1', require('./routes/api'));
|
||||
app.use('/client', express.static(path.join(__dirname, 'dist')));
|
||||
app.use('/admin', require('./routes/admin'));
|
||||
|
||||
// Static Routes.
|
||||
app.use('/client/', express.static(path.join(__dirname, 'dist')));
|
||||
//==============================================================================
|
||||
// ERROR HANDLING
|
||||
//==============================================================================
|
||||
|
||||
app.get('/admin*', (req, res) => {
|
||||
res.render('admin', {basePath: '/client/coral-admin'});
|
||||
const ErrNotFound = new Error('Not Found');
|
||||
ErrNotFound.status = 404;
|
||||
|
||||
// Catch 404 and forward to error handler.
|
||||
app.use((req, res, next) => {
|
||||
next(ErrNotFound);
|
||||
});
|
||||
|
||||
// General error handler. Respond with the message and error if we have it while
|
||||
// returning a status code that makes sense.
|
||||
if (app.get('env') === 'development') {
|
||||
app.use('/api', (err, req, res, next) => {
|
||||
res.status(err.status || 500);
|
||||
res.json({
|
||||
message: err.message,
|
||||
error: err
|
||||
});
|
||||
});
|
||||
|
||||
app.use('/', (err, req, res, next) => {
|
||||
res.status(err.status || 500);
|
||||
res.render('error', {
|
||||
message: err.message,
|
||||
error: err
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
app.use('/api', (err, req, res, next) => {
|
||||
res.status(err.status || 500);
|
||||
res.json({
|
||||
message: err.message,
|
||||
error: {}
|
||||
});
|
||||
});
|
||||
|
||||
app.use('/', (err, req, res, next) => {
|
||||
res.status(err.status || 500);
|
||||
res.render('error', {
|
||||
message: err.message,
|
||||
error: {}
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
node_modules
|
||||
public/bundle.js
|
||||
public/embed/comment-stream
|
||||
.DS_Store
|
||||
npm-debug.log
|
||||
yarn.lock
|
||||
@@ -1,5 +1,3 @@
|
||||
{
|
||||
"basePath": "admin",
|
||||
"talkHost": "http://localhost:16180",
|
||||
"xeniaHost": "http://localhost:16180"
|
||||
"basePath": "admin"
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "coral-admin",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "./node_modules/.bin/webpack --config webpack.config.js",
|
||||
"start": "./node_modules/.bin/webpack-dev-server --config webpack.config.dev.js --inline --hot --content-base public --port 3142"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"hammerjs": "2.0.8",
|
||||
"immutable": "3.8.1",
|
||||
"keymaster": "1.6.2",
|
||||
"material-design-lite": "1.2.1",
|
||||
"react": "^15.3.2",
|
||||
"react-dom": "^15.3.2",
|
||||
"react-mdl": "^1.7.2",
|
||||
"react-redux": "^4.4.5",
|
||||
"react-router": "^3.0.0",
|
||||
"redux": "3.6.0",
|
||||
"redux-thunk": "2.1.0",
|
||||
"timeago.js": "2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "6.5.0",
|
||||
"babel-core": "^6.18.2",
|
||||
"babel-loader": "^6.2.7",
|
||||
"copy-webpack-plugin": "3.0.1",
|
||||
"css-loader": "0.25.0",
|
||||
"json-loader": "0.5.4",
|
||||
"postcss-loader": "0.13.0",
|
||||
"postcss-modules": "0.5.2",
|
||||
"precss": "1.4.0",
|
||||
"standard": "8.2.0",
|
||||
"style-loader": "0.13.1",
|
||||
"webpack": "^1.13.3",
|
||||
"webpack-dev-server": "1.16.1"
|
||||
},
|
||||
"config": {
|
||||
"pre-git": {
|
||||
"commit-msg": [],
|
||||
"pre-commit": [],
|
||||
"pre-push": [],
|
||||
"post-commit": [],
|
||||
"post-merge": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-smart-import')({ /* ...options */ }),
|
||||
require('precss')({ /* ...options */ }),
|
||||
require('autoprefixer')({ /* ...options */ })
|
||||
]
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<title>Talk - Coral Admin</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
|
||||
<style media="screen">
|
||||
body, #root {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="client/coral-admin/bundle.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,32 +0,0 @@
|
||||
const path = require('path')
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const precss = require('precss')
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'bundle': path.join(__dirname, 'src', 'index')
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, '..', '..', 'dist', 'coral-admin'),
|
||||
filename: '[name].js'
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /.js$/, loader: 'babel', include: path.join(__dirname, 'src'), exclude: /node_modules/ },
|
||||
{ test: /\.json$/, loaders: 'json', include: __dirname, exclude: /node_modules/ },
|
||||
{ test: /.css$/, loaders: ['style-loader', 'css-loader?modules&localIdentName=[name]__[local]___[hash:base64:5]', 'postcss-loader'] }
|
||||
]
|
||||
},
|
||||
plugins: [ autoprefixer, precss ],
|
||||
resolve: {
|
||||
root: [
|
||||
path.resolve('./src'),
|
||||
path.resolve('../')
|
||||
]
|
||||
},
|
||||
devServer: {
|
||||
historyApiFallback: {
|
||||
index: '/'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
const path = require('path')
|
||||
const devConfig = require('./webpack.config.dev')
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const precss = require('precss')
|
||||
const Copy = require('copy-webpack-plugin')
|
||||
const webpack = require('webpack')
|
||||
|
||||
module.exports = Object.assign({}, devConfig, {
|
||||
module: {
|
||||
context: __dirname,
|
||||
loaders: [
|
||||
{ test: /.js$/, loader: 'babel', include: [path.join(__dirname, 'src'), path.join(__dirname, '../', 'coral-framework')], exclude: /node_modules/ },
|
||||
{ test: /.json$/, loader: 'json', include: __dirname, exclude: /node_modules/ },
|
||||
{ test: /.css$/, loaders: ['style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'postcss-loader'] }
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
autoprefixer,
|
||||
precss,
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': `"${`production`}"`,
|
||||
'VERSION': `"${require("./package.json").version})"`
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
@@ -1,41 +0,0 @@
|
||||
var path = require('path')
|
||||
var express = require('express')
|
||||
var http = require('http')
|
||||
var webpack = require('webpack')
|
||||
var config = require('./webpack.config.dev')
|
||||
var Dashboard = require('webpack-dashboard')
|
||||
var DashboardPlugin = require('webpack-dashboard/plugin')
|
||||
|
||||
var app = express()
|
||||
var server = http.Server(app)
|
||||
|
||||
var compiler = webpack(config)
|
||||
var dashboard = new Dashboard()
|
||||
compiler.apply(new DashboardPlugin(dashboard.setData))
|
||||
|
||||
app.use(express.static('public'))
|
||||
|
||||
app.use(require('webpack-dev-middleware')(compiler, {
|
||||
noInfo: true,
|
||||
quiet: true,
|
||||
publicPath: config.output.publicPath
|
||||
}))
|
||||
|
||||
app.use(require('webpack-hot-middleware')(compiler, {log: () => {}}))
|
||||
|
||||
app.get('/default.css', function (req, res) {
|
||||
res.sendFile(path.join(__dirname, '/style/default.css'))
|
||||
})
|
||||
|
||||
app.get('*', function (req, res) {
|
||||
res.sendFile(path.join(__dirname, 'index.html'))
|
||||
})
|
||||
|
||||
server.listen(6182, 'localhost', function (err) {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
return
|
||||
}
|
||||
|
||||
console.log('Listening at http://localhost:6182')
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="default.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato|Open+Sans" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="coralStream"/>
|
||||
<script src="./bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,70 +0,0 @@
|
||||
var path = require('path')
|
||||
var webpack = require('webpack')
|
||||
const Copy = require('copy-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
devtool: 'eval',
|
||||
entry: [
|
||||
'babel-polyfill',
|
||||
'webpack-hot-middleware/client',
|
||||
path.join(__dirname, 'src', 'app')
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, '..', '..','dist', 'coral-embed-stream'),
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/'
|
||||
},
|
||||
resolve: {
|
||||
root: [
|
||||
path.resolve(__dirname, 'src'),
|
||||
path.resolve(__dirname, '..')
|
||||
],
|
||||
extensions: ['', '.js', '.jsx']
|
||||
},
|
||||
plugins: [
|
||||
new Copy([{
|
||||
from: path.join(__dirname, 'index.html')
|
||||
},
|
||||
{
|
||||
from: path.join(__dirname, 'style', 'default.css')
|
||||
},
|
||||
{
|
||||
from: path.join(__dirname, 'public'),
|
||||
to: './'
|
||||
}]),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('development')
|
||||
}
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.ProvidePlugin({
|
||||
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
|
||||
}),
|
||||
new webpack.NoErrorsPlugin()
|
||||
],
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.(js|jsx)$/,
|
||||
|
||||
loaders: ['babel'],
|
||||
exclude: /node_modules/,
|
||||
include: path.join(__dirname, '../')
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
loader: 'style-loader!css-loader'
|
||||
}, {
|
||||
test: /\.png$/,
|
||||
loader: 'url-loader?limit=100000'
|
||||
}, {
|
||||
test: /\.(jpg|png|gif|svg)$/,
|
||||
loader: 'file-loader'
|
||||
}, {
|
||||
test: /\.json$/,
|
||||
loader: 'json-loader'
|
||||
}, {
|
||||
test: /\.woff$/,
|
||||
loader: 'url?limit=100000'
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const Copy = require('copy-webpack-plugin')
|
||||
|
||||
//Keeping this file for reference, it should move to a global webpack.
|
||||
|
||||
module.exports = {
|
||||
devtool: 'source-map',
|
||||
entry: [
|
||||
'babel-polyfill',
|
||||
path.join(__dirname, 'src', 'app')
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, '..', '..','dist', 'coral-embed-stream'),
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/dist/'
|
||||
},
|
||||
resolve: {
|
||||
root: [
|
||||
path.resolve(__dirname, 'src')
|
||||
],
|
||||
extensions: ['', '.js', '.jsx']
|
||||
},
|
||||
plugins: [
|
||||
new Copy([{
|
||||
from: path.join(__dirname, 'index.html')
|
||||
},
|
||||
{
|
||||
from: path.join(__dirname, 'style', 'default.css')
|
||||
},
|
||||
{
|
||||
from: path.join(__dirname, 'public'),
|
||||
to: './'
|
||||
},
|
||||
{
|
||||
from: path.resolve(__dirname, '..', 'coral-framework', 'i18n', 'translations'),
|
||||
to: './translations'
|
||||
}]),
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
|
||||
}),
|
||||
new webpack.ExtendedAPIPlugin()
|
||||
],
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.(js|jsx)$/,
|
||||
loaders: ['babel'],
|
||||
exclude: /node_modules/,
|
||||
include: path.join(__dirname, '../')
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
loader: 'style-loader!css-loader'
|
||||
}, {
|
||||
test: /\.png$/,
|
||||
loader: 'url-loader?limit=100000'
|
||||
}, {
|
||||
test: /\.jpg$/,
|
||||
loader: 'file-loader'
|
||||
}, {
|
||||
test: /\.json$/,
|
||||
loader: 'json-loader'
|
||||
}, {
|
||||
test: /\.woff$/,
|
||||
loader: 'url?limit=100000'
|
||||
}]
|
||||
}
|
||||
}
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"short_name": "Talk",
|
||||
"name": "Talk",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https://coralproject.net/images/icon-coral-white.svg",
|
||||
"sizes": "150x150"
|
||||
}
|
||||
],
|
||||
"start_url": "./",
|
||||
"display": "standalone"
|
||||
}
|
||||
+13
-7
@@ -5,7 +5,8 @@
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"start": "./bin/www",
|
||||
"build": "./node_modules/webpack/bin/webpack.js --config ./client/coral-embed-stream/webpack.config.js && cd client/coral-admin && npm install && npm run build",
|
||||
"build": "webpack --config webpack.config.js --bail",
|
||||
"build-watch": "webpack --config webpack.config.dev.js --watch",
|
||||
"lint": "eslint .",
|
||||
"pretest": "npm install",
|
||||
"test": "mocha tests --recursive",
|
||||
@@ -53,9 +54,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "6.5.0",
|
||||
"babel-core": "6.14.0",
|
||||
"babel-core": "^6.14.0",
|
||||
"babel-jest": "^15.0.0",
|
||||
"babel-loader": "6.2.5",
|
||||
"babel-loader": "^6.2.5",
|
||||
"babel-plugin-transform-async-to-generator": "^6.8.0",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||
"babel-plugin-transform-object-assign": "^6.8.0",
|
||||
@@ -67,26 +68,31 @@
|
||||
"chai": "^3.5.0",
|
||||
"chai-http": "^3.0.0",
|
||||
"copy-webpack-plugin": "^3.0.1",
|
||||
"css-loader": "0.25.0",
|
||||
"css-loader": "^0.25.0",
|
||||
"eslint": "^3.9.1",
|
||||
"exports-loader": "^0.6.3",
|
||||
"hammerjs": "^2.0.8",
|
||||
"immutable": "^3.8.1",
|
||||
"imports-loader": "^0.6.5",
|
||||
"json-loader": "^0.5.4",
|
||||
"keymaster": "^1.6.2",
|
||||
"material-design-lite": "^1.2.1",
|
||||
"mocha": "^3.1.2",
|
||||
"mocha-junit-reporter": "^1.12.1",
|
||||
"postcss-loader": "0.13.0",
|
||||
"postcss-loader": "^0.13.0",
|
||||
"postcss-modules": "0.5.2",
|
||||
"precss": "1.4.0",
|
||||
"pre-git": "^3.10.0",
|
||||
"precss": "^1.4.0",
|
||||
"pym.js": "^1.1.1",
|
||||
"react": "15.3.2",
|
||||
"react-dom": "15.3.2",
|
||||
"react-mdl": "^1.7.2",
|
||||
"react-redux": "^4.4.5",
|
||||
"react-router": "^3.0.0",
|
||||
"redux": "^3.6.0",
|
||||
"redux-thunk": "^2.1.0",
|
||||
"regenerator": "^0.8.46",
|
||||
"style-loader": "0.13.1",
|
||||
"style-loader": "^0.13.1",
|
||||
"supertest": "^2.0.1",
|
||||
"timeago.js": "^2.0.3",
|
||||
"webpack": "^1.13.2",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
const express = require('express');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/embed/stream/preview', (req, res) => {
|
||||
res.render('embed-stream', {basePath: '/client/embed/stream'});
|
||||
});
|
||||
|
||||
router.get('*', (req, res) => {
|
||||
res.render('admin', {basePath: '/client/coral-admin'});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
@@ -4,9 +4,9 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<title>Talk - Coral Admin</title>
|
||||
<base href="/client/coral-admin/" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
|
||||
<link rel="stylesheet" href="<%= basePath %>/default.css">
|
||||
<style media="screen">
|
||||
body, #root {
|
||||
width: 100%;
|
||||
@@ -17,7 +17,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="bundle.js" charset="utf-8"></script>
|
||||
<div id="coralStream"></div>
|
||||
<script src="<%= basePath %>/bundle.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Error</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<pre><%= message %></pre>
|
||||
|
||||
<pre><%= error.stack %></pre>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,90 @@
|
||||
const path = require('path');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const precss = require('precss');
|
||||
const Copy = require('copy-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
// Edit the build targets and embeds below.
|
||||
|
||||
const buildTargets = [
|
||||
'coral-admin'
|
||||
];
|
||||
|
||||
const buildEmbeds = [
|
||||
'stream'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
devtool: 'inline-source-map',
|
||||
entry: buildTargets.reduce((entry, target) => {
|
||||
|
||||
// Add the entry for the bundle.
|
||||
entry[`${target}/bundle`] = [
|
||||
'babel-polyfill',
|
||||
path.join(__dirname, 'client/', target, '/src/index')
|
||||
];
|
||||
|
||||
return entry;
|
||||
}, buildEmbeds.reduce((entry, embed) => {
|
||||
|
||||
// Add the entry for the bundle.
|
||||
entry[`embed/${embed}/bundle`] = [
|
||||
'babel-polyfill',
|
||||
path.join(__dirname, 'client/', `coral-embed-${embed}`, '/src/index')
|
||||
];
|
||||
|
||||
return entry;
|
||||
}, {})),
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: '[name].js'
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
loader: 'babel',
|
||||
exclude: /node_modules/,
|
||||
test: /\.js$/
|
||||
},
|
||||
{
|
||||
loader: 'json',
|
||||
test: /\.json$/,
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
loaders: ['style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'postcss-loader'],
|
||||
test: /.css$/,
|
||||
},
|
||||
{
|
||||
loader: 'url-loader?limit=100000',
|
||||
test: /\.png$/
|
||||
},
|
||||
{
|
||||
loader: 'file-loader',
|
||||
test: /\.(jpg|png|gif|svg)$/
|
||||
},
|
||||
{
|
||||
loader: 'url?limit=100000',
|
||||
test: /\.woff$/
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new Copy(buildEmbeds.map(embed => ({
|
||||
from: path.join(__dirname, 'client', `coral-embed-${embed}`, 'style'),
|
||||
to: path.join(__dirname, 'dist', 'embed', embed)
|
||||
}))),
|
||||
autoprefixer,
|
||||
precss,
|
||||
new webpack.ProvidePlugin({
|
||||
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
root: [
|
||||
path.join(__dirname, 'client'),
|
||||
...buildTargets.map(target => path.join(__dirname, 'client', target, 'src')),
|
||||
...buildEmbeds.map(embed => path.join(__dirname, 'client', `coral-embed-${embed}`, 'src'))
|
||||
]
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
const webpack = require('webpack');
|
||||
const devConfig = require('./webpack.config.dev');
|
||||
|
||||
// Disable source maps.
|
||||
devConfig.devtool = null;
|
||||
|
||||
devConfig.plugins = devConfig.plugins.concat([
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||
new webpack.optimize.DedupePlugin()
|
||||
]);
|
||||
|
||||
module.exports = devConfig;
|
||||
Reference in New Issue
Block a user