Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Internal: Implement webpack-dev-server #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"style-loader": "^1.0.0",
"terser-webpack-plugin": "^2.2.1",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6"
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.9.0"
},
"engines": {
"node": ">=8.0.0",
Expand All @@ -72,6 +73,7 @@
"url": "https://github.com/ckeditor/ckeditor5-build-classic.git"
},
"scripts": {
"start": "webpack-dev-server",
"build": "webpack --mode production",
"lint": "eslint --quiet '**/*.js'",
"stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css' 'docs/**/*.css'",
Expand Down
4 changes: 2 additions & 2 deletions sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ <h2>Sample</h2>
<p>This is an instance of the <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#classic-editor">classic editor build</a>.</p>

<figure class="image">
<img src="../tests/manual/sample.jpg" alt="Autumn fields" />
<img src="/manual/sample.jpg" alt="Autumn fields" />
</figure>

<p>You can use this sample to validate whether your <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html">custom build</a> works fine.</p>
</div>

<script src="../build/ckeditor.js"></script>
<script src="/assets/ckeditor.js"></script>
<script>
ClassicEditor.create( document.querySelector( '#editor' ) )
.then( editor => {
Expand Down
10 changes: 10 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ module.exports = {
libraryExport: 'default'
},

devServer: {
publicPath: '/assets/',
contentBase: [
path.resolve( __dirname, 'sample' ),
path.resolve( __dirname, 'tests' ),
],
watchContentBase: true,
compress: true
},

optimization: {
minimizer: [
new TerserPlugin( {
Expand Down