Skip to content

Commit 2a37927

Browse files
committed
Updated build system
Signed-off-by: Andrew Welch <andrew@nystudio107.com>
1 parent 8e21321 commit 2a37927

File tree

16 files changed

+12907
-7190
lines changed

16 files changed

+12907
-7190
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
# CRAFT ENVIRONMENT
2+
.env.php
3+
.env.sh
4+
.env
5+
16
# COMPOSER
27
/vendor
38

49
# BUILD FILES
510
/bower_components/*
611
/node_modules/*
712
/build/*
13+
/yarn-error.log
814

915
# MISC FILES
1016
.cache
@@ -17,3 +23,12 @@
1723
*.sublime-project
1824
*.tmproj
1925
*.tmproject
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
config.codekit3
32+
prepros-6.config
33+
34+
# BUILD FILES

package-lock.json

Lines changed: 12277 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,16 @@
2121
},
2222
"private": true,
2323
"scripts": {
24-
"dev": "webpack-dev-server --config webpack.dev.js --progress --hide-modules",
25-
"build": "webpack --config webpack.prod.js"
24+
"debug": "webpack-dev-server --config webpack.dev.js",
25+
"dev": "webpack-dashboard -- webpack-dev-server --config webpack.dev.js",
26+
"build": "webpack --config webpack.prod.js --progress --hide-modules"
2627
},
27-
"paths": {
28-
"src": {
29-
"base": "./src/assetbundles/transcoder/src/",
30-
"js": "./src/assetbundles/transcoder/src/js/",
31-
"css": "./src/assetbundles/transcoder/src/css/"
32-
},
33-
"dist": {
34-
"base": "./src/assetbundles/transcoder/dist/",
35-
"public": "/cpresources/transcoder/",
36-
"devPublic": "http://192.168.10.10:8080",
37-
"clean": [
38-
"./js",
39-
"./css"
40-
]
41-
},
42-
"copyFiles": [
28+
"browserslist": {
29+
"production": [
30+
"> 1%",
31+
"last 2 versions",
32+
"Firefox ESR"
4333
],
44-
"manifest": {
45-
"basePath": ""
46-
},
47-
"templates": "./src/templates/"
48-
},
49-
"entries": {
50-
"transcoder": "Transcoder.js",
51-
"welcome": "Welcome.js"
52-
},
53-
"babelConfig": {
5434
"legacyBrowsers": [
5535
"> 1%",
5636
"last 2 versions",
@@ -69,26 +49,6 @@
6949
"not Edge < 15"
7050
]
7151
},
72-
"purgeCss": {
73-
"paths": [
74-
"./src/templates/**/*.{twig,html}"
75-
],
76-
"whitelist": [
77-
"../css/components.pcss"
78-
],
79-
"whitelistPatterns": [],
80-
"extensions": [
81-
"html",
82-
"js",
83-
"twig",
84-
"vue"
85-
]
86-
},
87-
"urls": {},
88-
"vars": {
89-
"cssName": "styles",
90-
"jsName": "transcoder"
91-
},
9252
"devDependencies": {
9353
"@babel/core": "^7.1.0",
9454
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
@@ -98,14 +58,22 @@
9858
"@babel/runtime": "^7.0.0",
9959
"autoprefixer": "^9.1.5",
10060
"babel-loader": "^8.0.2",
101-
"clean-webpack-plugin": "^0.1.19",
61+
"clean-webpack-plugin": "^3.0.0",
10262
"copy-webpack-plugin": "^4.5.2",
10363
"css-loader": "^1.0.0",
10464
"cssnano": "^4.1.0",
65+
"dotenv": "^6.1.0",
10566
"file-loader": "^2.0.0",
10667
"git-rev-sync": "^1.12.0",
10768
"glob-all": "^3.1.0",
10869
"ignore-loader": "^0.1.2",
70+
"imagemin-gifsicle": "^6.0.0",
71+
"imagemin-mozjpeg": "^8.0.0",
72+
"imagemin-optipng": "^6.0.0",
73+
"imagemin-svgo": "^7.0.0",
74+
"imagemin-webp": "^5.0.0",
75+
"imagemin-webp-webpack-plugin": "^3.1.0",
76+
"img-loader": "^3.0.1",
10977
"mini-css-extract-plugin": "^0.4.3",
11078
"moment": "^2.22.2",
11179
"optimize-css-assets-webpack-plugin": "^5.0.1",
@@ -128,14 +96,16 @@
12896
"webpack": "^4.19.1",
12997
"webpack-bundle-analyzer": "^3.0.2",
13098
"webpack-cli": "^3.1.1",
99+
"webpack-dashboard": "^3.0.0",
131100
"webpack-dev-server": "^3.1.9",
132101
"webpack-manifest-plugin": "^2.0.4",
133102
"webpack-merge": "^4.1.4",
134103
"webpack-notifier": "^1.6.0"
135104
},
136105
"dependencies": {
137-
"@babel/polyfill": "^7.0.0",
138-
"tailwindcss": "^0.6.6",
106+
"core-js": "^3.0.0",
107+
"regenerator-runtime": "^0.13.2",
108+
"tailwindcss": "^1.0.4",
139109
"vue": "^2.5.17",
140110
"vue-confetti": "^0.4.1"
141111
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// Import our CSS
22
import styles from '../css/app.pcss';
3+
import icon from '../img/Transcoder-icon.svg';
34

45
const main = async () => {
56
};
67

78
main().then({});
9+
10+
// Accept HMR as per: https://webpack.js.org/api/hot-module-replacement#accept
11+
if (module.hot) {
12+
module.hot.accept();
13+
}
Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
// Dashboard main
2-
const main = async () => {
3-
// Async load the vue module
4-
const Vue = await import(/* webpackChunkName: "vue" */ 'vue');
5-
// Create our vue instance
6-
const vm = new Vue.default({
7-
el: "#cp-nav-content",
8-
delimiters: ["${", "}"],
9-
components: {
10-
'confetti': () => import(/* webpackChunkName: "confetti" */ '../vue/Confetti.vue')
11-
},
12-
data: {
13-
},
14-
methods: {
15-
},
16-
mounted() {
17-
}
18-
});
19-
};
20-
// Execute async function
21-
main().then({});
1+
import Vue from 'vue';
2+
import Confetti from '../vue/Confetti.vue';
3+
4+
// Create our vue instance
5+
const vm = new Vue({
6+
el: "#cp-nav-content",
7+
delimiters: ["${", "}"],
8+
components: {
9+
'confetti': Confetti,
10+
},
11+
data: {
12+
},
13+
methods: {
14+
},
15+
mounted() {
16+
},
17+
});
18+
19+
// Accept HMR as per: https://webpack.js.org/api/hot-module-replacement#accept
20+
if (module.hot) {
21+
module.hot.accept();
22+
}

src/assetbundles/transcoder/src/vue/Confetti.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
</template>
55

66
<script>
7-
import Vue from 'vue'
8-
import VueConfetti from 'vue-confetti'
7+
import Vue from 'vue';
8+
import VueConfetti from 'vue-confetti';
99
1010
Vue.use(VueConfetti);
1111
1212
export default {
1313
mounted: function() {
14-
this.$confetti.start()
14+
this.$confetti.start({
15+
shape: 'rect',
16+
colors: ['DodgerBlue', 'OliveDrab', 'Gold', 'pink', 'SlateBlue', 'lightblue', 'Violet', 'PaleGreen', 'SteelBlue', 'SandyBrown', 'Chocolate', 'Crimson']
17+
});
1518
setTimeout(() => {
16-
this.$confetti.stop()
19+
this.$confetti.stop();
1720
}, 5000);
1821
},
1922
methods: {

0 commit comments

Comments
 (0)