Merge pull request #1 from SundownDEV/api

Webpack assets and README
pull/5/head
Raphael Cerveaux 2018-05-07 11:13:51 +02:00 committed by GitHub
commit 5d4d0462ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 107 additions and 1 deletions

7
.gitignore vendored
View File

@ -10,3 +10,10 @@ node_modules
###> symfony/web-server-bundle ###
/.web-server-pid
###< symfony/web-server-bundle ###
###> symfony/webpack-encore-pack ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-pack ###

View File

@ -1 +1,5 @@
# Am-I-late
Web application made with Symfony 4 and React.
The api server listen to port 3000 and the front app to port 8000.

0
assets/.gitignore vendored Normal file
View File

View File

@ -11,6 +11,7 @@
"symfony/lts": "^4@dev",
"symfony/maker-bundle": "^1.4",
"symfony/orm-pack": "^1.0",
"symfony/webpack-encore-pack": "^1.0",
"symfony/yaml": "^4.0"
},
"require-dev": {

30
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "6c5efcc52b8bd26da932d44a37546333",
"content-hash": "30549615a9be96a562ed2e879c7d6a12",
"packages": [
{
"name": "api-platform/api-pack",
@ -3743,6 +3743,34 @@
"homepage": "https://symfony.com",
"time": "2018-04-20T10:04:09+00:00"
},
{
"name": "symfony/webpack-encore-pack",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/webpack-encore-pack.git",
"reference": "f9f4e91659e5f55de370d6aebe77e64bce35e4d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/webpack-encore-pack/zipball/f9f4e91659e5f55de370d6aebe77e64bce35e4d3",
"reference": "f9f4e91659e5f55de370d6aebe77e64bce35e4d3",
"shasum": ""
},
"type": "symfony-pack",
"extra": {
"thanks": {
"name": "symfony/webpack-encore",
"url": "https://github.com/symfony/webpack-encore"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A pack for Symfony Encore",
"time": "2017-12-21T02:20:09+00:00"
},
{
"name": "symfony/yaml",
"version": "v4.0.9",

20
makefile Normal file
View File

@ -0,0 +1,20 @@
.PHONY: install api-start api-stop front-watch front-build front-build-prod
install:
composer install;
npm install;
api-start:
bin/console server:start;
api-stop:
bin/console server:stop;
front-watch:
./node_modules/.bin/encore dev --watch
front-build:
./node_modules/.bin/encore dev
front-build-prod:
./node_modules/.bin/encore production

13
package.json Normal file
View File

@ -0,0 +1,13 @@
{
"devDependencies": {
"@symfony/webpack-encore": "^0.19.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production"
}
}

View File

@ -263,6 +263,15 @@
"ref": "dae9b39fd6717970be7601101ce5aa960bf53d9a"
}
},
"symfony/webpack-encore-pack": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "0e8ef1deeaef761e1defbec0be694237660ab13a"
}
},
"symfony/yaml": {
"version": "v4.0.9"
},

24
webpack.config.js Normal file
View File

@ -0,0 +1,24 @@
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('front/public')
// the public path used by the web server to access the previous directory
.setPublicPath('/public')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
// .enableVersioning(Encore.isProduction())
// uncomment to define the assets of the project
.addEntry('js/app', './assets/js/app.js')
.addStyleEntry('css/app', './assets/css/app.scss')
// uncomment if you use Sass/SCSS files
.enableSassLoader()
// uncomment for legacy applications that require $/jQuery as a global variable
// .autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();