Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt docs to webpack 2 #14

Closed
obestwalter opened this issue Feb 22, 2017 · 2 comments
Closed

Adapt docs to webpack 2 #14

obestwalter opened this issue Feb 22, 2017 · 2 comments

Comments

@obestwalter
Copy link
Contributor

obestwalter commented Feb 22, 2017

Webpack 2 is out and there are a lot of breaking changes.

The README needs to be adapted to webpack 2 but I did not completely sort out what needs to be adjusted. Also there are a lot of recommendations in the webpack issues to go back to some 2.x.beta version so it might be a good idea to wait a while to jump on 2.x.

@StefanYohansson addressed some important issues already in #13 (comment) but the ExtractTextPlugin config needs to be adjusted as well.

This seems to be a helpful article about the migration: http://javascriptplayground.com/blog/2016/10/moving-to-webpack-2/

I don't know my way aroud too well around this fancy webdev stuff yet to provide the finished solution, so I would propose until somebody else does to add some version pinning to the README
I made it work for me with this install invocation:

npm install --save-dev \
    [email protected] \
    [email protected] \
    babel-loader \
    css-loader \
    file-loader \
    node-sass \
    sass-loader \
    style-loader \
    url-loader \
    webpack babel-core \
@torian257x
Copy link

torian257x commented Jul 12, 2017

this still results in an error to me. I get when installing via npm install --save-dev [email protected] [email protected] babel-loader css-loader file-loader de-sass sass-loader style-loader url-loader webpack babel-core


├─┬ [email protected] 
│ └── [email protected] 
└─┬ UNMET PEER DEPENDENCY [email protected]
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ UNMET PEER DEPENDENCY [email protected]

then when starting I get the same annoying error again

jossnaz@osboxes:~/IdeaProjects/lektor_ironscales/src/webpack$ cd ..
jossnaz@osboxes:~/IdeaProjects/lektor_ironscales/src$ lektor server -f webpack
 * Project path: /home/jossnaz/IdeaProjects/lektor_ironscales/src/lektor_ironscales.lektorproject
 * Output path: /home/jossnaz/.cache/lektor/builds/aee0e3bca93424dd2c4f468dc6ad4bdb
Started source info update
Finished source info update in 0.13 sec
Started build
Running npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of ajv@>=5.0.0 but none was installed.
npm WARN [email protected] requires a peer of webpack@^1.9.11 but none was installed.
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of ajv@>=5.0.0 but none was installed.
npm WARN [email protected] requires a peer of webpack@^1.9.11 but none was installed.
Starting webpack build
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
   object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
 - configuration.resolve.extensions[0] should not be empty.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
   object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
 - configuration.resolve.extensions[0] should not be empty.
Webpack build finished
Finished build in 3.67 sec
Started prune

my package.json


{
  "name": "lektor-webpack",
  "version": "1.0.0",
  "private": true,
  "devDependencies": {
    "babel-core": "^6.25.0",
    "babel-loader": "^7.1.1",
    "css-loader": "^0.28.4",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.11.2",
    "node-sass": "^4.5.3",
    "sass-loader": "^6.0.6",
    "style-loader": "^0.18.2",
    "url-loader": "^0.5.9",
    "webpack": "^3.2.0"
  }
}

@obestwalter
Copy link
Contributor Author

I guess this has been resolved in some other way? I am not using this project anymore so I don't know, but if it would still be a problem there would be some activity here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants