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

Commit

Permalink
Internal: Implement webpack-dev-server
Browse files Browse the repository at this point in the history
  • Loading branch information
christianztamayo committed Jan 11, 2020
1 parent 3a56294 commit 91621b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
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

0 comments on commit 91621b6

Please sign in to comment.