Skip to content

Commit

Permalink
TTK-27296: Rename js file when created (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
albacodina authored Oct 22, 2024
1 parent 614959f commit 8d4f167
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Resources/public/paella/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="teltek-paella-player.js"></script>
<script src="teltek-paella-player-2024-10-22.js"></script>
<style>
body {
margin: 0px;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Resources/public/paella/dist/teltek-paella-player.js.map

This file was deleted.

187 changes: 187 additions & 0 deletions Resources/public/paella/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Resources/public/paella/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@babel/core": "^7.12.16",
"@babel/preset-env": "^7.12.16",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"html-webpack-plugin": "^5.5.0",
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/paella/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="teltek-paella-player.js"></script>
<script src="teltek-paella-player-2024-10-22.js"></script>
<style>
body {
margin: 0px;
Expand Down
12 changes: 10 additions & 2 deletions Resources/public/paella/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
const dateString = `${year}-${month}-${day}`;

module.exports = {
entry: './src/index.js',
output: {
path: path.join(__dirname, "dist"),
filename: 'teltek-paella-player.js',
sourceMapFilename: 'teltek-paella-player.js.map'
filename: `teltek-paella-player-${dateString}.js`,
sourceMapFilename: `teltek-paella-player-${dateString}.js.map`
},
devtool: 'source-map',
devServer: {
Expand Down Expand Up @@ -61,6 +68,7 @@ module.exports = {
},

plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: [
{ from: './config', to: 'config' },
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/PaellaPlayer/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% if live is not defined and event is not defined %}
{{ parent() }}
{% endif %}
<script type="text/javascript" src="{{ asset('bundles/pumukitpaellaplayer/paella/dist/teltek-paella-player.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/pumukitpaellaplayer/paella/dist/teltek-paella-player-2024-10-22.js') }}"></script>
{% endblock %}

{% block title %}{{ parent() }} {% endblock %}
Expand Down

0 comments on commit 8d4f167

Please sign in to comment.