Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
31860acc
Commit
31860acc
authored
Sep 13, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makefile: add recipe for setting the CDN url as the `publicPath`
parent
68e34351
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
14 deletions
+29
-14
Makefile
Makefile
+7
-7
package.json
package.json
+2
-1
webpack.dev.js
webpack.dev.js
+11
-3
webpack.prod.js
webpack.prod.js
+9
-3
No files found.
Makefile
View file @
31860acc
...
...
@@ -38,7 +38,6 @@ help:
@
echo
" build Create minified builds of converse.js and all its dependencies."
@
echo
" clean Remove all NPM packages."
@
echo
" check Run all tests."
@
echo
" css Generate CSS from the Sass files."
@
echo
" dev Set up the development environment and build unminified resources. To force a fresh start, run 'make clean' first."
@
echo
" devserver Set up the development environment and start the webpack dev server."
@
echo
" html Make standalone HTML files of the documentation."
...
...
@@ -131,9 +130,6 @@ devserver: stamp-npm
########################################################################
## Builds
.PHONY
:
css
css
:
sass/*.scss dist/website.css dist/website.min.css
dist/converse.js
::
stamp-npm dev
dist/converse.css
::
stamp-npm dev
...
...
@@ -173,15 +169,19 @@ BUILDS = src/headless/dist/converse-headless.min.js
@converse/headless
:
src/headless
src/headless/dist/converse-headless.min.js
:
src webpack.common.js stamp-npm @converse/headless
npm run
converse-headless.min.j
s
npm run
headles
s
.PHONY
:
dist
dist
::
build
.PHONY
:
build
build
::
stamp-npm css
npm run build
build
::
stamp-npm
npm run dev
&&
npm run build
.PHONY
:
cdn
cdn
::
stamp-npm
npm run cdn
########################################################################
## Tests
...
...
package.json
View file @
31860acc
...
...
@@ -17,8 +17,9 @@
"scripts"
:
{
"serve"
:
"webpack-dev-server --config webpack.serve.js"
,
"clean"
:
"rm -rf node_modules stamp-npm dist *.zip"
,
"
converse-headless.min.j
s"
:
"webpack --config webpack.headless.js"
,
"
headles
s"
:
"webpack --config webpack.headless.js"
,
"nodeps"
:
"webpack --config webpack.nodeps.js"
,
"cdn"
:
"ASSET_PATH=https://cdn.conversejs.org/dist npm run dev && ASSET_PATH=https://cdn.conversejs.org/dist npm run build"
,
"build"
:
"webpack --config webpack.prod.js"
,
"dev"
:
"webpack --config webpack.dev.js"
,
"watch"
:
"webpack --watch --config webpack.dev.js"
,
...
...
webpack.dev.js
View file @
31860acc
/* global module */
/* global module
, process
*/
const
merge
=
require
(
"
webpack-merge
"
);
const
prod
=
require
(
"
./webpack.prod.js
"
);
const
webpack
=
require
(
'
webpack
'
);
const
MiniCssExtractPlugin
=
require
(
'
mini-css-extract-plugin
'
);
const
ASSET_PATH
=
process
.
env
.
ASSET_PATH
||
'
/dist/
'
;
// eslint-disable-line no-process-env
module
.
exports
=
merge
(
prod
,
{
output
:
{
publicPath
:
'
/dist/
'
,
// URL base path for all assets
publicPath
:
ASSET_PATH
,
filename
:
'
converse.js
'
,
},
optimization
:
{
minimize
:
false
,
},
devtool
:
'
source-map
'
,
plugins
:
[
new
MiniCssExtractPlugin
({
filename
:
'
converse.css
'
})]
plugins
:
[
new
MiniCssExtractPlugin
({
filename
:
'
../dist/converse.min.css
'
}),
new
webpack
.
DefinePlugin
({
// This makes it possible for us to safely use env vars on our code
'
process.env.ASSET_PATH
'
:
JSON
.
stringify
(
ASSET_PATH
)
})
],
});
webpack.prod.js
View file @
31860acc
/* global __dirname, module */
/* global __dirname, module
, process
*/
const
common
=
require
(
"
./webpack.common.js
"
);
const
merge
=
require
(
"
webpack-merge
"
);
const
path
=
require
(
'
path
'
);
const
webpack
=
require
(
'
webpack
'
);
const
MiniCssExtractPlugin
=
require
(
'
mini-css-extract-plugin
'
);
const
ASSET_PATH
=
process
.
env
.
ASSET_PATH
||
'
/dist/
'
;
// eslint-disable-line no-process-env
module
.
exports
=
merge
(
common
,
{
output
:
{
publicPath
:
'
/dist/
'
,
// URL base path for all assets
publicPath
:
ASSET_PATH
,
filename
:
'
converse.min.js
'
,
},
plugins
:
[
new
MiniCssExtractPlugin
({
filename
:
'
../dist/converse.min.css
'
})
new
MiniCssExtractPlugin
({
filename
:
'
../dist/converse.min.css
'
}),
new
webpack
.
DefinePlugin
({
// This makes it possible for us to safely use env vars on our code
'
process.env.ASSET_PATH
'
:
JSON
.
stringify
(
ASSET_PATH
)
})
],
mode
:
"
production
"
,
devtool
:
"
source-map
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment