Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-web-pages
Commits
cbef9127
Commit
cbef9127
authored
Feb 22, 2018
by
julienmege
Browse files
integrate primer using webpack
parent
7ab239ca
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
buildSrc/src/main/groovy/BonitaPagePluginExtension.groovy
View file @
cbef9127
...
...
@@ -2,4 +2,5 @@ class BonitaPagePluginExtension {
String
nodeVersion
String
npmVersion
String
frontendBuildDir
List
<
String
>
sourceDirectories
}
\ No newline at end of file
page-hello-world-react/build.gradle
View file @
cbef9127
...
...
@@ -2,6 +2,7 @@ apply plugin: BonitaPagePlugin
bonitaPage
{
frontendBuildDir
=
'build'
sourceDirectories
=
[
'public'
]
}
// Workaround to manage React-CLI non conventional build directory
...
...
page-hello-world/build.gradle
0 → 100644
View file @
cbef9127
apply
plugin:
BonitaPagePlugin
page-hello-world/
src/
index.html
→
page-hello-world/index.html
View file @
cbef9127
...
...
@@ -3,7 +3,6 @@
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
<link
rel=
"stylesheet"
href=
"../theme/theme.css"
>
</head>
<body>
...
...
@@ -13,7 +12,10 @@
<h1>
Hello, world!
</h1>
<p>
...
</p>
<p><a
class=
"btn btn-primary btn-lg"
href=
"#"
role=
"button"
>
Learn more
</a></p>
<button
class=
"btn btn-primary"
type=
"button"
>
Button button
</button>
</div>
</div>
<script
src=
"bundle.js"
></script>
</body>
</html>
\ No newline at end of file
page-hello-world/package-lock.json
View file @
cbef9127
This diff is collapsed.
Click to expand it.
page-hello-world/package.json
View file @
cbef9127
...
...
@@ -4,10 +4,23 @@
"private"
:
true
,
"description"
:
""
,
"scripts"
:
{
"build"
:
"mkdirp dist && ncp ./src/index.html ./dist/index.html"
"build"
:
"webpack"
,
"build-css"
:
"node-sass --include-path src src/main.scss public/css/main.css"
},
"devDependencies"
:
{
"clean-webpack-plugin"
:
"^0.1.18"
,
"css-loader"
:
"^0.28.9"
,
"html-webpack-plugin"
:
"^2.30.1"
,
"mkdirp"
:
"^0.5.1"
,
"ncp"
:
"^2.0.0"
"ncp"
:
"^2.0.0"
,
"node-sass"
:
"^4.7.2"
,
"sass-loader"
:
"^6.0.6"
,
"style-loader"
:
"^0.20.2"
,
"webpack"
:
"^3.11.0"
},
"dependencies"
:
{
"lodash"
:
"^4.17.5"
,
"primer"
:
"^10.3.0"
,
"primer-buttons"
:
"^2.5.3"
}
}
page-hello-world/src/index.js
0 → 100644
View file @
cbef9127
import
_
from
'
lodash
'
;
import
'
./index.scss
'
;
function
component
()
{
var
element
=
document
.
createElement
(
'
div
'
);
element
.
innerHTML
=
_
.
join
([
'
Hello
'
,
'
webpack
'
],
'
'
);
return
element
;
}
var
element
=
document
.
createElement
(
'
button
'
);
element
.
className
=
'
btn btn-primary
'
;
element
.
innerText
=
'
Button
'
;
document
.
body
.
appendChild
(
element
);
document
.
body
.
appendChild
(
component
());
page-hello-world/src/index.scss
0 → 100644
View file @
cbef9127
@import
"primer-buttons/index.scss"
;
\ No newline at end of file
page-hello-world/webpack.config.js
0 → 100644
View file @
cbef9127
const
path
=
require
(
'
path
'
);
const
HtmlWebpackPlugin
=
require
(
'
html-webpack-plugin
'
);
const
CleanWebpackPlugin
=
require
(
'
clean-webpack-plugin
'
);
module
.
exports
=
{
entry
:
'
./src/index.js
'
,
plugins
:
[
new
CleanWebpackPlugin
([
'
dist
'
]),
new
HtmlWebpackPlugin
({
title
:
'
Output Management
'
})
],
output
:
{
filename
:
'
bundle.js
'
,
path
:
path
.
resolve
(
__dirname
,
'
dist
'
)
},
module
:
{
rules
:
[
{
test
:
/
\.
scss$/
,
use
:
[{
loader
:
"
style-loader
"
// creates style nodes from JS strings
},
{
loader
:
"
css-loader
"
// translates CSS into CommonJS
},
{
loader
:
"
sass-loader
"
,
// compiles Sass to CSS
options
:
{
includePaths
:
[
'
node_modules
'
],
},
}],
}
]
}
};
\ No newline at end of file
settings.gradle
View file @
cbef9127
pluginManagement
{
repositories
{
mavenLocal
()
maven
{
url
'http://repositories.rd.lan/maven/releases/'
}
maven
{
url
'http://repositories.rd.lan/maven/releases/'
}
gradlePluginPortal
()
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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