- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
backend webpack js/ .yarnrc webpack.config.js package.json assets/ -> frond w-6ren">
目录结构
admin/ -> backend webpack
js/
.yarnrc
webpack.config.js
package.json
assets/ -> frond webpack
管理/文件内容:
.yarnrc
--modules-folder node_modules_admin
这正确创建了 admin/node_modules_admin管理员使用 boostrap 3,前端使用 boostrap 4,因此需要单独的文件夹。
webpack.config.js
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('./../public/admin/')
// the public path used by the web server to access the previous directory
.setPublicPath('/admin')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.createSharedEntry('vendor', [
'jquery',
'bootstrap',
// 'fullcalendar',
'./js/vendor.js',
// you can also extract CSS - this will create a 'vendor.css' file
// this CSS will *not* be included in page1.css or page2.css anymore
// 'bootstrap-sass/assets/stylesheets/_bootstrap.scss'
])
.addEntry('js/admin', './js/admin.js')
.addEntry('js/datatables', './js/datatables.js')
.addStyleEntry('css/appLess', './css/app.less')
.addStyleEntry('css/admin', './css/admin.scss')
// 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()
.autoProvideVariables({
$: "jquery",
jQuery: "jquery",
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default'],
})
// .enableVersioning()
.enableLessLoader()
// .addLoader(
// {test: require.resolve('signature_pad'), loader: 'expose?SignaturePad'},
// )
.enableBuildNotifications()
// .addLoader(
// {
// test: require.resolve('wow.js/dist/wow.js'),
// loader: 'exports?this.WOW'
// })
.addLoader(
{
test: /\.(jpe?g|png|gif)$/i,
loader:"file-loader",
query:{
name:'[name].[ext]',
outputPath:'images/'
//the images will be emmited to public/assets/images/ folder
//the images will be put in the DOM <style> tag as eg. background: url(assets/images/image.png);
}
})
;
let config = Encore.getWebpackConfig();
config.resolve.alias = {
'handlebars': 'handlebars/dist/handlebars.min.js'
};
// module.exports = {
// entry: [
// 'fullcalendar',
// ...
// ]
// }
module.exports = config;
package.json
{
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
"css-loader": "^1.0.0",
"file-loader": "^1.1.11",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",
"url-loader": "^1.0.1",
"webpack-notifier": "^1.6.0"
},
"dependencies": {
"admin-lte": "^2.4.8",
"bootstrap-editable": "^1.0.1",
"datatables-all": "^1.10.13",
"datatables-buttons": "^1.0.3",
"datatables-fixedheader": "^3.1.0",
"datatables.net": "^1.10.19",
"datatables.net-bs": "^1.10.19",
"datatables.net-buttons-bs": "^1.5.1",
"datatables.net-dt": "^1.10.19",
"datatables.net-fixedheader-bs": "^3.1.3",
"eonasdan-bootstrap-datetimepicker": "^3.1.3",
"fullcalendar": "^2.9.1",
"handlebars": "^4.0.12",
"jquery": "^2.2.4",
"jquery-form": "^4.2.2",
"jquery-slimscroll": "^1.3.8",
"jquery-ui-bootstrap": "^1.0.0",
"jquery-validation": "^1.18.0",
"jquery.fancytree": "^2.30.0",
"js-cookie": "^2.2.0",
"masonry-layout": "^4.2.2",
"popover": "^2.4.1",
"readmore-js": "^2.2.1",
"script-loader": "^0.7.2",
"select2": "^4.0.6-rc.1",
"timeago": "^1.6.3",
"timeago.js": "^4.0.0-beta.1",
"webpack-icons-installer": "^2.0.0",
"webpack-jquery-ui": "^2.0.1",
"x-editable": "^1.5.1"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production"
}
}
config/framework.yaml
framework:
secret: '%env(APP_SECRET)%'
#default_locale: en
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: ~
assets:
packages:
backend:
json_manifest_path: '%kernel.project_dir%/public/admin/manifest.json'
frontend:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
我进入管理目录
~/PhpstormProjects/vista_bralion_docker/admin$ yarn install
yarn install v1.12.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.94s.
尝试生成文件
~/PhpstormProjects/vista_bralion_docker/admin$ yarn run encore dev --watch
yarn run v1.12.1
error Command "encore" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我尝试直接运行安可
:~/PhpstormProjects/vista_bralion_docker/admin$ node_modules_admin/@symfony/webpack-encore/bin/encore.js
internal/modules/cjs/loader.js:550
throw err;
^
Error: Cannot find module '@babel/core'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object.<anonymous> (/home/grek/PhpstormProjects/vista_bralion_docker/admin/node_modules_admin/@symfony/webpack-encore/lib/config/parse-runtime.js:15:15)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
这里是admin/yarn.lock
最佳答案
我的解决方案是执行以下命令:
$ yarn add --dev vue vue-loader@15.x vue-template-compiler
这是结果:
然后一切正常
其他可能的解决方案是:
yarn 运行--ignore-engines
我在带有 digital ocean 的cloudways上使用它
关于symfony - 找不到错误命令 "encore"。 (单独的后端 webpack),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53302142/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!