mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 05:46:15 +08:00
Adjusted build process
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# Talk [](https://circleci.com/gh/coralproject/talk)
|
||||
|
||||
A commenting platform from [The Coral Project](https://coralproject.net). Talk enters a closed beta in March 2017, but you can download the code for our alpha here. [Read more about Talk here.](https://coralproject.net/products/talk.html)
|
||||
A commenting platform from [The Coral Project](https://coralproject.net). Talk enters a closed beta in March 2017, but you can download the code for our alpha here. [Read more about Talk here.](https://coralproject.net/products/talk.html)
|
||||
|
||||
Third party licenses are available via the `/client/3rdpartylicenses.txt`
|
||||
endpoint when the server is running with built assets.
|
||||
|
||||
## Contributing to Talk
|
||||
|
||||
|
||||
+3
-2
@@ -6,8 +6,8 @@
|
||||
"scripts": {
|
||||
"start": "./bin/cli serve --jobs",
|
||||
"dev-start": "nodemon --config .nodemon.json --exec \"./bin/cli -c .env serve --jobs\"",
|
||||
"build": "NODE_ENV=production webpack -p --config webpack.config.js --bail",
|
||||
"build-watch": "NODE_ENV=development webpack --config webpack.config.js --watch",
|
||||
"build": "NODE_ENV=production webpack --progress -p --config webpack.config.js --bail",
|
||||
"build-watch": "NODE_ENV=development webpack --progress --config webpack.config.js --watch",
|
||||
"lint": "eslint bin/* .",
|
||||
"lint-fix": "eslint bin/* . --fix",
|
||||
"test": "TEST_MODE=unit NODE_ENV=test mocha -R ${MOCHA_REPORTER:-spec}",
|
||||
@@ -130,6 +130,7 @@
|
||||
"jsdom": "^9.8.3",
|
||||
"json-loader": "^0.5.4",
|
||||
"keymaster": "^1.6.2",
|
||||
"license-webpack-plugin": "^0.4.2",
|
||||
"material-design-lite": "^1.2.1",
|
||||
"mocha": "^3.1.2",
|
||||
"mocha-junit-reporter": "^1.12.1",
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ const router = express.Router();
|
||||
router.use('/api/v1', require('./api'));
|
||||
router.use('/admin', require('./admin'));
|
||||
router.use('/embed', require('./embed'));
|
||||
router.get('/embed.js', (req, res) => res.sendFile(path.join(__dirname, '../dist/coral-embed/bundle.js')));
|
||||
router.get('/embed.js', (req, res) => res.sendFile(path.join(__dirname, '../dist/embed.js')));
|
||||
router.get('/embed.js.map', (req, res) => res.sendFile(path.join(__dirname, '../dist/embed.js.map')));
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
router.use('/assets', require('./assets'));
|
||||
|
||||
+18
-5
@@ -2,14 +2,14 @@ const path = require('path');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const precss = require('precss');
|
||||
const Copy = require('copy-webpack-plugin');
|
||||
const LicenseWebpackPlugin = require('license-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
// Edit the build targets and embeds below.
|
||||
|
||||
const buildTargets = [
|
||||
'coral-admin',
|
||||
'coral-docs',
|
||||
'coral-embed'
|
||||
'coral-docs'
|
||||
];
|
||||
|
||||
const buildEmbeds = [
|
||||
@@ -18,7 +18,12 @@ const buildEmbeds = [
|
||||
|
||||
module.exports = {
|
||||
devtool: 'cheap-source-map',
|
||||
entry: buildTargets.reduce((entry, target) => {
|
||||
entry: Object.assign({}, {
|
||||
'embed': [
|
||||
'babel-polyfill',
|
||||
path.join(__dirname, 'client/coral-embed/src/index')
|
||||
]
|
||||
}, buildTargets.reduce((entry, target) => {
|
||||
|
||||
// Add the entry for the bundle.
|
||||
entry[`${target}/bundle`] = [
|
||||
@@ -27,7 +32,7 @@ module.exports = {
|
||||
];
|
||||
|
||||
return entry;
|
||||
}, buildEmbeds.reduce((entry, embed) => {
|
||||
}, {}), buildEmbeds.reduce((entry, embed) => {
|
||||
|
||||
// Add the entry for the bundle.
|
||||
entry[`embed/${embed}/bundle`] = [
|
||||
@@ -39,6 +44,7 @@ module.exports = {
|
||||
}, {})),
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
publicPath: '/client/',
|
||||
filename: '[name].js',
|
||||
|
||||
// NOTE: this causes all exports to override the global.Coral, so no more
|
||||
@@ -50,7 +56,10 @@ module.exports = {
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
test: /\.js$/
|
||||
test: /\.js$/,
|
||||
query: {
|
||||
cacheDirectory: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'json-loader',
|
||||
@@ -85,6 +94,10 @@ module.exports = {
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new LicenseWebpackPlugin({
|
||||
pattern: /^(MIT|ISC|BSD.*)$/,
|
||||
addUrl: true
|
||||
}),
|
||||
new Copy([
|
||||
...buildEmbeds.map(embed => ({
|
||||
from: path.join(__dirname, 'client', `coral-embed-${embed}`, 'style'),
|
||||
|
||||
@@ -4385,6 +4385,12 @@ libqp@1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8"
|
||||
|
||||
license-webpack-plugin@^0.4.2:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/license-webpack-plugin/-/license-webpack-plugin-0.4.2.tgz#188df5418a72ab61cad648b9ffd9355be270242b"
|
||||
dependencies:
|
||||
object-assign "^4.1.0"
|
||||
|
||||
linkify-it@^1.2.0:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-1.2.4.tgz#0773526c317c8fd13bd534ee1d180ff88abf881a"
|
||||
|
||||
Reference in New Issue
Block a user